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; }
/** * * @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; }
public function defaultAttributes() { $attr = parent::defaultAttributes(); $attr['default_salutation'] = \GO::t('defaultSalutationTpl', 'addressbook'); return $attr; }
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(); }
/** * Returns a static model of itself * * @param String $className * @return Settings */ public static function model($className = __CLASS__) { return parent::model($className); }
protected function init() { $this->columns['name']['unique'] = true; return parent::init(); }