Changeset 32
- Timestamp:
- 07/17/08 23:56:01 (4 months ago)
- Files:
-
- trunk/web/index.php (modified) (2 diffs)
- trunk/web/src/admin.php (added)
- trunk/web/src/config.php (modified) (1 diff)
- trunk/web/src/init.php (modified) (1 diff)
- trunk/web/src/personal.php (deleted)
- trunk/web/templates/foot.tpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/web/index.php
r31 r32 3 3 require_once('src/init.php'); 4 4 require_once('src/isbn.php'); 5 require_once('src/admin.php'); 5 6 6 7 $smarty = initSmarty(); 7 8 initDB(); 8 9 $xajax = initXajax(); 10 $auth = initAuth(); 11 12 if ($auth->checkAuth()) 13 $smarty->assign('login',true); 9 14 10 15 $smarty->register_function( 'printXajaxHeader', 'printXajaxHeader' ); … … 30 35 break; 31 36 37 case ('logout'): 38 if ($auth->checkAuth()){ 39 session_unset(); 40 $auth->logout(); 41 } 42 header("Location: " . $_SERVER['PHP_SELF']); 43 break; 44 32 45 case ('personal'): 33 46 if( isset($_POST['search']) ) { 34 $content = personalSearch(mysql_real_escape_string(trim($_POST['code'])));35 $smarty->assign('content',$content);36 $smarty->assign('fields',$fields);37 }38 47 $content = personalSearch(mysql_real_escape_string(trim($_POST['code']))); 48 $smarty->assign('content',$content); 49 $smarty->assign('fields',$fields); 50 } 51 39 52 $smarty->display("personal.tpl"); 40 53 break; 54 55 case ('isbn'): 56 if ($auth->checkAuth()){ 57 $smarty->assign('allfields',$allfields); 41 58 42 case ('isbn'): 43 $smarty->assign('allfields',$allfields); 44 $smarty->display("isbn.tpl"); 59 $smarty->display("isbn.tpl"); 60 } 45 61 break; 46 62 trunk/web/src/config.php
r31 r32 1 1 <? 2 2 3 define('ROOT',dirname( __FILE__ ) );3 define('ROOT',dirname( __FILE__ ) . '/..'); 4 4 define('DBHOST','localhost'); 5 5 define('DBUNAME','username'); trunk/web/src/init.php
r31 r32 2 2 require_once(ROOT . '/lib/smarty/Smarty.class.php'); 3 3 require_once(ROOT . '/lib/xajax/xajax_core/xajax.inc.php'); 4 require_once( 'ajax.php');4 require_once(ROOT . '/src/ajax.php'); 5 5 6 6 function &initSmarty(){ trunk/web/templates/foot.tpl
r29 r32 3 3 - <a href="index.php?action=complex"> ricerca avanzata </a> 4 4 - <a href="index.php?action=personal"> i miei libri </a> 5 {if $login} 5 6 - <a href="index.php?action=isbn"> cerca isbn </a> 7 - <a href="index.php?action=logout"> logout </a> 8 {else} 9 - <a href="index.php?action=isbn&login"> cerca isbn </a> 10 {/if} 6 11 </div> 7 12 </body>

