예제 #1
0
 public function __construct($table = '')
 {
     parent::__construct();
     $this->_error = array();
     $this->_fields = array();
     if (empty($table)) {
         $this->_table = StringHelper::camelToFlat(__CLASS__);
     } else {
         $this->_table = $table;
     }
 }
예제 #2
0
 public function __construct()
 {
     parent::__construct();
     $this->skip = array();
     foreach (get_object_vars($this) as $key => $val) {
         if ($key == 'skip') {
             continue;
         }
         $this->_init($key);
         $this->skip[$key] = array();
     }
 }
예제 #3
0
 /**
  * constructor
  * @param mixed $login is user login required
  */
 public function __construct($login = false)
 {
     parent::__construct();
     // get front controller instance
     $this->fc = FrontController::getInstance();
     // instantiate page
     $this->page = new PageModel();
     // check login ?
     if ($login && APP_SETUP_USER_MODEL) {
         if (!$this->fc->user->isLoggedIn()) {
             NaviHelper::redirect($this->fc->getUrl('login'));
         }
     }
 }
예제 #4
0
 /**
  * constructor
  * @param mixed $login is user login required
  */
 public function __construct($login = false, $iphone = false)
 {
     parent::__construct();
     // get front controller instance
     $this->fc = FrontController::getInstance();
     // instantiate page
     $this->page = new PageModel();
     // detect iphone
     if (preg_match('/' . APP_IPHONE_AGENT . '/', $_SERVER['HTTP_USER_AGENT']) && !$iphone) {
         NaviHelper::redirect($this->fc->getUrl('iphone'));
     }
     // check login ?
     if ($login && APP_SETUP_USER_MODEL) {
         if (!$this->fc->user->isLoggedIn()) {
             if (is_string($login)) {
                 if ($this->fc->controller != StringHelper::flatToCamel($login, true) || $this->fc->action != 'login') {
                     NaviHelper::redirect($this->fc->getUrl($login, 'login'));
                 }
             } else {
                 NaviHelper::redirect($this->fc->getUrl('login'));
             }
         }
     }
 }