コード例 #1
0
 /**
  * Initialize API by loading the user's token and enforcing authorization
  *
  * @return null
  */
 public static function init()
 {
     self::$method = preg_replace("/[^A-Za-z0-9_ ]/", '', \TaskerMAN\Core\IO::GET('method'));
     self::$token = \TaskerMAN\Core\IO::GET('token');
     self::enforceLogin();
     self::execute();
 }
コード例 #2
0
 /** 
  * Initalizes the web interface by enforcing logins, validating that the page
  * that's requested exists and that the user has permission to view it, then
  * loads the user's information, then finally executes the page
  */
 public static function init()
 {
     Session::init();
     self::$page = preg_replace("/[^A-Za-z0-9_ ]/", '', IO::GET('p'));
     self::enforceLogin();
     self::validatePage();
     self::loadLoggedInUser();
     self::execute();
 }
コード例 #3
0
 /**
  * Set a session variable to a given value
  *
  * @param string $key
  * @param mixed $value
  * @return boolean
  */
 public static function set($key, $value)
 {
     $_SESSION[$key] = IO::sanitize($value);
     return true;
 }