]> git.andy128k.dev Git - ipf.git/commitdiff
User Accounts
authoravl <alex.litovchenko@gmail.com>
Mon, 24 Nov 2008 13:22:38 +0000 (15:22 +0200)
committeravl <alex.litovchenko@gmail.com>
Mon, 24 Nov 2008 13:22:38 +0000 (15:22 +0200)
ipf/application.php
ipf/auth/app.php
ipf/orm/validator/timestamp.php

index 441c2dea12c6469ed1df4dda344adae9ef8dc26b..5ed303658a9572e38c0aa3c990dece77730023f3 100644 (file)
@@ -1,10 +1,10 @@
 <?php
 
 abstract class IPF_Application{
-    
+
     protected $models = array();
     protected $name = null;
-    
+
     public function __construct($data){
         $this->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');
     }
index 2656a6be170ac6341d27ee8f8b312fa09282ff23..f119f451f6d6a3ea24cfecc3f224c6ffb562c967 100644 (file)
@@ -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();
index b2143083353a97ea47ce4a03d3bf456000736ee5..ab951616f3f88b32d4002e3c44aaee7177857946 100644 (file)
@@ -23,7 +23,7 @@ class IPF_ORM_Validator_Timestamp
 
         if ( ! $timeValidator->validate($time)) {
             return false;
-        } 
+        }
 
         return true;
     }