Example #1
0
 public static function initListeners()
 {
     $c = new \GO\Core\Controller\AuthController();
     $c->addListener('headstart', 'GO\\Chat\\ChatModule', 'headstart');
     GO::session()->addListener('login', 'GO\\Chat\\ChatModule', 'login');
     parent::initListeners();
 }
Example #2
0
 public function install()
 {
     parent::install();
     $category = new Category();
     $category->name = GO::t('general', 'notes');
     $category->save();
     $category->acl->addGroup(GO::config()->group_everyone, Acl::READ_PERMISSION);
 }
 public static function loadSettings(&$settingsController, &$params, &$response, $user)
 {
     $acl = FreebusypermissionsModule::getFreeBusyAcl($user->id);
     if (!empty($acl)) {
         $response['data']['freebusypermissions_acl_id'] = $acl->acl_id;
     }
     return parent::loadSettings($settingsController, $params, $response, $user);
 }
Example #4
0
 public function install()
 {
     parent::install();
     $category = new Model\Category();
     $category->name = \GO::t('general', 'bookmarks');
     $category->save();
     $category->acl->addGroup(\GO::config()->group_internal, \GO\Base\Model\Acl::READ_PERMISSION);
 }
Example #5
0
 public static function loadSettings(&$settingsController, &$params, &$response, $user)
 {
     $startModule = \GO\Base\Model\Module::model()->findByPk($user->start_module);
     $response['data']['start_module_name'] = $startModule ? $startModule->moduleManager->name() : '';
     $company = \GO\Addressbook\Model\Company::model()->findByPk($response['data']['company_id'], false, true);
     if ($company) {
         $response['data']['company_name'] = $company->name;
     }
     $response['remoteComboTexts']['holidayset'] = \GO::t($user->holidayset);
     return parent::loadSettings($settingsController, $params, $response, $user);
 }
Example #6
0
 public static function submitSettings(&$settingsController, &$params, &$response, $user)
 {
     GO::config()->save_setting('email_use_plain_text_markup', isset($params['use_html_markup']) ? '0' : '1', GO::user()->user_id);
     GO::config()->save_setting('email_show_cc', isset($params['email_show_cc']) ? 1 : 0, GO::user()->user_id);
     GO::config()->save_setting('email_show_bcc', isset($params['email_show_bcc']) ? 1 : 0, GO::user()->user_id);
     GO::config()->save_setting('email_skip_unknown_recipients', isset($params['skip_unknown_recipients']) ? '1' : '0', GO::user()->user_id);
     GO::config()->save_setting('email_always_request_notification', isset($params['always_request_notification']) ? '1' : '0', GO::user()->user_id);
     GO::config()->save_setting('email_always_respond_to_notifications', isset($params['always_respond_to_notifications']) ? '1' : '0', GO::user()->user_id);
     GO::config()->save_setting('email_font_size', $params['font_size'], GO::user()->user_id);
     return parent::submitSettings($settingsController, $params, $response, $user);
 }
Example #7
0
 public static function loadSettings(&$settingsController, &$params, &$response, $user)
 {
     $settings = Model\Settings::model()->getDefault($user);
     $response['data'] = array_merge($response['data'], $settings->getAttributes());
     $tasklist = $settings->tasklist;
     if ($tasklist) {
         $response['data']['default_tasklist_id'] = $tasklist->id;
         $response['remoteComboTexts']['default_tasklist_id'] = $tasklist->name;
     }
     //$response = Controller\Task::reminderSecondsToForm($response);
     return parent::loadSettings($settingsController, $params, $response, $user);
 }
Example #8
0
 public function install()
 {
     if (\GO::modules()->isInstalled('site')) {
         $alreadyExists = \GO\Site\Model\Site::model()->findSingleByAttribute('module', 'defaultsite');
         if (!$alreadyExists) {
             $siteProperties = array('name' => \GO::t('name', 'defaultsite'), 'user_id' => 1, 'domain' => '*', 'module' => 'defaultsite', 'ssl' => '0', 'mod_rewrite' => '0', 'mod_rewrite_base_path' => '/', 'base_path' => '', 'language' => '');
             $defaultSite = new \GO\Site\Model\Site();
             $defaultSite->setAttributes($siteProperties);
             $defaultSite->save();
         }
     }
     return parent::install();
 }
Example #9
0
 public function uninstall()
 {
     parent::uninstall();
     $cron = \GO\Base\Cron\CronJob::model()->findSingleByAttribute('job', 'GO\\Dropbox\\Cron\\Sync');
     if (!$cron) {
         // No cronjob found, so nothing needs to be deleted.
         return true;
     }
     if (!$cron->delete()) {
         // Try to delete the cronjob, if it's not possible then throw an exception.
         throw new \Exception('The Dropbox systemtask could not be deleted automatically. Please try to delete it manually in the "System tasks module."');
     } else {
         return true;
     }
 }
Example #10
0
 public function install()
 {
     if (GO::modules()->isInstalled('site')) {
         $alreadyExists = Site::model()->findSingleByAttribute('module', 'adminmanual');
         if (!$alreadyExists) {
             $siteProperties = array('name' => "Manual", 'user_id' => 1, 'domain' => '*', 'module' => 'manualsite', 'ssl' => '0', 'mod_rewrite' => '0', 'mod_rewrite_base_path' => '/', 'base_path' => '', 'language' => 'en');
             $defaultSite = new Site();
             $defaultSite->setAttributes($siteProperties);
             $defaultSite->save();
             $home = new GO\Site\Model\Content();
             $home->site_id = $defaultSite->id;
             $home->title = "Home";
             $home->slug = "";
             $home->template = "/manualsite/home";
             $home->save();
             $chapter = new GO\Site\Model\Content();
             $chapter->parent_id = $home->id;
             $chapter->site_id = $home->id;
             $chapter->title = "Example chapter";
             $chapter->content = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
             $chapter->slug = "example-chapter";
             $chapter->template = "/manualsite/content";
             $chapter->save();
             $sub = new GO\Site\Model\Content();
             $sub->parent_id = $chapter->id;
             $sub->site_id = $defaultSite->id;
             $sub->title = "Sub 1";
             $sub->content = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
             $sub->slug = "example-chapter";
             $sub->template = "/manualsite/content";
             $sub->save();
             $sub = new GO\Site\Model\Content();
             $sub->parent_id = $chapter->id;
             $sub->site_id = $defaultSite->id;
             $sub->title = "Sub 2";
             $sub->content = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
             $sub->slug = "example-chapter";
             $sub->template = "/manualsite/content";
             $sub->save();
         }
         $category = \GO\Customfields\Model\Category::model()->createIfNotExists("GO\\Site\\Model\\Site", "Extra");
         \GO\Customfields\Model\Field::model()->createIfNotExists($category->id, "Google tracking code");
     }
     return parent::install();
 }
Example #11
0
 public function install()
 {
     parent::install();
     $domains = empty(\GO::config()->serverclient_domains) ? array() : explode(',', \GO::config()->serverclient_domains);
     foreach ($domains as $domain) {
         if (!empty($domain)) {
             $domainModel = new Model\Domain();
             $domainModel->domain = $domain;
             $domainModel->save();
             $mailboxModel = new Model\Mailbox();
             $mailboxModel->domain_id = $domainModel->id;
             $mailboxModel->username = '******' . $domain;
             $mailboxModel->password = '******';
             $mailboxModel->name = "System administrator";
             $mailboxModel->save();
         }
     }
 }
Example #12
0
 public function install()
 {
     parent::install();
     $group = new Model\Group();
     $group->name = \GO::t('calendars', 'calendar');
     $group->save();
     $cron = new \GO\Base\Cron\CronJob();
     $cron->name = 'Calendar publisher';
     $cron->active = true;
     $cron->runonce = false;
     $cron->minutes = '0';
     $cron->hours = '*';
     $cron->monthdays = '*';
     $cron->months = '*';
     $cron->weekdays = '*';
     $cron->job = 'GO\\Calendar\\Cron\\CalendarPublisher';
     $cron->save();
 }
Example #13
0
 public static function initListeners()
 {
     $c = new \GO\Core\Controller\AuthController();
     $c->addListener('inlinescripts', 'GO\\Settings\\SettingsModule', 'inlinescripts');
     return parent::initListeners();
 }
Example #14
0
 public static function loadSettings(&$settingsController, &$params, &$response, $user)
 {
     $response['data']['comments_enable_read_more'] = self::loadReadMore();
     return parent::loadSettings($settingsController, $params, $response, $user);
 }
Example #15
0
 public function install()
 {
     parent::install();
     $template = new \GO\files\Model\Template();
     $template->name = \GO::t('wordtextdoc', 'files');
     $template->content = file_get_contents(\GO::modules()->files->path . 'install/templates/empty.docx');
     $template->extension = 'docx';
     $template->save();
     $template->acl->addGroup(\GO::config()->group_internal, \GO\Base\Model\Acl::READ_PERMISSION);
     $template = new \GO\files\Model\Template();
     $template->name = \GO::t('ootextdoc', 'files');
     $template->content = file_get_contents(\GO::modules()->files->path . 'install/templates/empty.odt');
     $template->extension = 'odt';
     $template->save();
     $template->acl->addGroup(\GO::config()->group_internal, \GO\Base\Model\Acl::READ_PERMISSION);
 }
Example #16
0
 public function checkDatabase(&$response)
 {
     $this->setFolderPermissions();
     return parent::checkDatabase($response);
 }
Example #17
0
 protected function getModuleManager()
 {
     if (!isset($this->_moduleManager)) {
         $this->_moduleManager = \GO\Base\Module::findByModuleId($this->id);
     }
     return $this->_moduleManager;
 }
Example #18
0
 public static function initListeners()
 {
     \GO\Base\Model\User::model()->addListener("save", "GO\\Serverclient\\ServerclientModule", "saveUser");
     return parent::initListeners();
 }
Example #19
0
 public static function initListeners()
 {
     $c = new \GO\Core\Controller\AuthController();
     $c->addListener('head', 'GO\\Customcss\\CustomcssModule', 'head');
     return parent::initListeners();
 }