示例#1
0
 public static function fields()
 {
     if (!self::$_fields) {
         $i = self::getInstance();
         $a = $i->toArray();
         $ak = array_keys($a);
         self::$_fields = $ak;
     }
     return self::$_fields;
 }
示例#2
0
 /**
  * Performs an authentication attempt
  *
  * @throws Zend_Auth_Adapter_Exception If authentication cannot
  *                                     be performed
  * @return Zend_Auth_Result
  */
 public function authenticate()
 {
     $stub = Zupal_People::getInstance();
     $user = $stub->find_one(array('username' => array($this->get_username(), 'LIKE')));
     $encrypted = Zupal_People::encrypt_password($this->get_password(), $user->identity());
     if ($user && $user->is_saved() && $this->get_password() == $user->password) {
         // TODO: incorpoprate encryption
         $result = new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $user->toArray());
     } else {
         $result = new Zend_Auth_Result(Zend_Auth_Result::FAILURE, NULL);
     }
     return $result;
 }
示例#3
0
 public static function field_map($pReload = FALSE)
 {
     if (is_null(self::$_field_map)) {
         // process
         self::$_field_map = array();
         foreach (Zupal_People::fields() as $field) {
             self::$_field_map['person_' . $field] = array('join' => 'person', 'field' => $field);
         }
         foreach (Zupal_Media_Media::fields() as $field) {
             self::$_field_map['media_' . $field] = array('join' => 'media', 'field' => $field);
         }
     }
     return self::$_field_map;
 }
 /**
  *
  */
 public function dataAction()
 {
     $this->_helper->layout->disableLayout();
     $this->view->data = Zupal_People::getInstance()->render_data(array(), 'email');
 }
示例#5
0
 function person($pReload = FALSE)
 {
     if ($pReload || is_null($this->_person)) {
         if ($this->person_id) {
             $person = new Zupal_People($this->person_id);
             if (!$person->isSaved()) {
                 $person = new Zupal_People();
                 $person->save();
                 $this->person_id = $person->identity();
             }
         } else {
             $person = new Zupal_People();
             $person->save();
             $this->person_id = $person->identity();
         }
         // process
         $this->_person = $person;
     }
     return $this->_person;
 }