From: avl Date: Mon, 24 Nov 2008 13:22:38 +0000 (+0200) Subject: User Accounts X-Git-Tag: 0.5~452 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=407a1582e02eb48b52c719702ccc3846acf15da9;p=ipf.git User Accounts --- diff --git a/ipf/application.php b/ipf/application.php index 441c2de..5ed3036 100644 --- a/ipf/application.php +++ b/ipf/application.php @@ -1,10 +1,10 @@ setName(); if (array_key_exists('models',$data)){ @@ -15,22 +15,22 @@ abstract class IPF_Application{ } } } - + protected function setName(){ - $this->name = str_replace('_App', '', get_class($this)); + $this->name = str_replace('_App', '', get_class($this)); if (strpos($this->name,'IPF_')===0) $this->path = IPF::get('ipf_path').DIRECTORY_SEPARATOR.'ipf'.DIRECTORY_SEPARATOR.strtolower(str_replace('_',DIRECTORY_SEPARATOR,str_replace('IPF_','',$this->name))); else $this->path = IPF::get('project_path').DIRECTORY_SEPARATOR.strtolower(str_replace('_',DIRECTORY_SEPARATOR,$this->name)); $this->path .= DIRECTORY_SEPARATOR; - } + } public function generateSql(){ if (count($this->models)==0) return; return IPF_ORM::generateSqlFromModels($this->path.'models'); } - + public function modelList(){ return $this->models; } @@ -43,7 +43,6 @@ abstract class IPF_Application{ return str_replace('ipf_','',strtolower($this->name)); } - public function getTitle(){ return $this->name; } @@ -58,7 +57,7 @@ abstract class IPF_Application{ return; return IPF_ORM::createTablesFromModels($this->path.'models'); } - + public function generateModels(){ IPF_ORM::generateModelsFromYaml($this->path.'models.yml', $this->path.'models'); } diff --git a/ipf/auth/app.php b/ipf/auth/app.php index 2656a6b..f119f45 100644 --- a/ipf/auth/app.php +++ b/ipf/auth/app.php @@ -7,7 +7,7 @@ class IPF_Auth_App extends IPF_Application{ 'models'=>array('User','Role') )); } - + static function login($request, $user){ $request->user = $user; $request->session->clear(); @@ -16,6 +16,10 @@ class IPF_Auth_App extends IPF_Application{ $user->save(); } + public function getTitle(){ + return 'User Accounts'; + } + static function logout($request){ $request->user = new User(); $request->session->clear(); diff --git a/ipf/orm/validator/timestamp.php b/ipf/orm/validator/timestamp.php index b214308..ab95161 100644 --- a/ipf/orm/validator/timestamp.php +++ b/ipf/orm/validator/timestamp.php @@ -23,7 +23,7 @@ class IPF_ORM_Validator_Timestamp if ( ! $timeValidator->validate($time)) { return false; - } + } return true; }