Exemple #1
0
 public function process($data)
 {
     $db = Zend_Registry::get('db');
     $userMapper = new C3op_Auth_UserMapper($db);
     if ($this->isValid($data) !== true) {
         throw new C3op_Form_UserEditException('Invalid data!');
     } else {
         $id = $data['id'];
         $user = $userMapper->findById($id);
         $user->SetName($data['name']);
         $user->SetLogin($data['login']);
         $user->SetEmail($data['email']);
         $user->SetRole($data['role']);
         if ($data['password'] != "") {
             $user->SetPassword($data['password']);
         }
         $userMapper->update($user);
     }
 }
Exemple #2
0
 private function InitUserWithCheckedId(C3op_Auth_UserMapper $mapper)
 {
     return $mapper->findById($this->checkIdFromGet());
 }