示例#1
0
 protected function actionSubmit($params)
 {
     $text = $params['login_screen_text'];
     $reportFeedback = '';
     if (preg_match("/^<br[^>]*>\$/", $text)) {
         $text = "";
     }
     \GO::config()->save_setting('login_screen_text', $text);
     \GO::config()->save_setting('login_screen_text_title', $_POST['login_screen_text_title']);
     \GO::config()->save_setting('login_screen_text_enabled', !empty($_POST['login_screen_text_enabled']) ? '1' : '0');
     if (!empty($params['addressbook_name_template'])) {
         \GO\Base\Model\AbstractUserDefaultModel::setNameTemplate("GO\\Addressbook\\Model\\Addressbook", $params['addressbook_name_template']);
     }
     if (!empty($params['task_name_template'])) {
         \GO\Base\Model\AbstractUserDefaultModel::setNameTemplate("GO\\Tasks\\Model\\Tasklist", $params['task_name_template']);
     }
     if (isset($params['GO\\Tasks\\Model\\Tasklist_change_all_names'])) {
         $this->_updateAllDefaultTasklists($reportFeedback);
     }
     if (!empty($params['calendar_name_template'])) {
         \GO\Base\Model\AbstractUserDefaultModel::setNameTemplate("GO\\Calendar\\Model\\Calendar", $params['calendar_name_template']);
     }
     if (isset($params['GO\\Calendar\\Model\\Calendar_change_all_names'])) {
         $this->_updateAllDefaultCalendars($reportFeedback);
     }
     $response['feedback'] = !empty($reportFeedback) ? $reportFeedback : '';
     $response['success'] = true;
     return $response;
 }
示例#2
0
 /**
  * 
  * @param \GO\Base\Model\User $user
  * @return Tasklist
  */
 public function getDefault(\GO\Base\Model\User $user, &$createdNew = false)
 {
     $default = parent::getDefault($user, $createdNew);
     if ($createdNew) {
         $pt = new PortletTasklist();
         $pt->user_id = $user->id;
         $pt->tasklist_id = $default->id;
         $pt->save();
     }
     return $default;
 }
示例#3
0
 public function defaultAttributes()
 {
     $attr = parent::defaultAttributes();
     $attr['default_salutation'] = \GO::t('defaultSalutationTpl', 'addressbook');
     return $attr;
 }
示例#4
0
文件: User.php 项目: ajaboa/crmpuan
 protected function afterDelete()
 {
     //delete all acl records
     $stmt = AclUsersGroups::model()->find(array("by" => array(array('user_id', $this->id))));
     while ($r = $stmt->fetch()) {
         $r->delete();
     }
     $defaultModels = AbstractUserDefaultModel::getAllUserDefaultModels();
     foreach ($defaultModels as $model) {
         $model->deleteByAttribute('user_id', $this->id);
     }
     //		deprecated. It's inefficient and can be done with listeners
     //		GO::modules()->callModuleMethod('deleteUser', array(&$this));
     return parent::afterDelete();
 }
示例#5
0
 /**
  * Returns a static model of itself
  * 
  * @param String $className
  * @return Settings 
  */
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }
示例#6
0
 protected function init()
 {
     $this->columns['name']['unique'] = true;
     return parent::init();
 }