Example #1
0
 /**
  * Deletes user. Unlike standard model rows, ca_users rows should never actually be deleted because they need to exist for logging purposes.
  * So this version of delete() marks the row as deleted by setting ca_users.userclass = 255 and *not* invoking to BaseModel::delete()
  * @access public
  * @return bool Returns true if no error, false if error occurred
  */
 public function delete($pb_delete_related = false, $pa_options = null, $pa_fields = null, $pa_table_list = null)
 {
     $this->clearErrors();
     $this->set('userclass', 255);
     if ($this->getPrimaryKey() > 0) {
         try {
             AuthenticationManager::deleteUser($this->get('user_name'));
         } catch (Exception $e) {
             $this->opo_log->log(array('CODE' => 'SYS', 'SOURCE' => 'ca_users/delete', 'MESSAGE' => _t('Authentication adapter could not delete user. Message was: %1', $e->getMessage())));
         }
     }
     return $this->update();
 }