phpUserTrack
[ class tree: phpUserTrack ] [ index: phpUserTrack ] [ all elements ]

Source for file site.php

Documentation is available at site.php

  1. <?php
  2. require_once './include/version.php';
  3. require_once './lib/core.php';
  4.  
  5. require('smarty/libs/Smarty.class.php');
  6. $smarty = new Smarty();
  7.  
  8. $smarty->plugins_dir[] = 'include';
  9. require_once $smarty->_get_plugin_filepath('function', 'html_doctype');
  10.  
  11. try {
  12.     $login = new login(true);
  13.     $smarty->assign('login', $login);
  14. } catch (LoginException $e) {
  15.     header( 'Location: login.php' ) ;
  16. } 
  17.  
  18. if (isset($_POST['submit'])) {
  19.     $db = new phpusertrack_site();
  20.     $db->addSite($_POST['name'], $_POST['url'], $_POST['desc']);
  21.     $notify[] = array('title' => 'Site Added', 
  22.         'desc' => '\'' . $_POST['name'] . '\' was successfully added',
  23.         'type' => 'success'
  24.     );
  25.     $smarty->assign('siteAdded', true);
  26. }
  27.  
  28. $smarty->assign('notifMsg', $notify);
  29.  
  30. $smarty->display('header.tpl');
  31. $smarty->display('site.tpl');
  32. $smarty->display('footer.tpl');
  33.  
  34. ?>

Documentation generated on Tue, 06 Nov 2007 09:22:12 -0800 by phpDocumentor 1.4.0a2