Exemplo n.º 1
0
 public function admin()
 {
     if ($this->is_back()) {
         if ($this->parent->get_type() == 'Base_Admin') {
             $this->parent->reset();
         } elseif (Base_BoxCommon::main_module_instance()->get_type() == $this->get_type()) {
             Base_BoxCommon::pop_main();
         }
         return;
     }
     Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
     $gb = $this->init_module(Utils_GenericBrowser::module_name(), null, 'rb_custom');
     $gb->set_table_columns(array(array('name' => __('Table')), array('name' => __('Caption')), array('name' => __('Menu Entry'))));
     $tabs = DB::GetAll('SELECT * FROM recordbrowser_custom_recordsets ORDER BY tab ASC');
     foreach ($tabs as $t) {
         $gbr = $gb->get_new_row();
         if (!$t['active']) {
             $gbr->add_action($this->create_callback_href(array($this, 'set_active'), array($t['id'], true)), 'Activate', null, 'active-off');
         } else {
             $gbr->add_action($this->create_callback_href(array($this, 'set_active'), array($t['id'], false)), 'Deactivate', null, 'active-on');
         }
         $gbr->add_action($this->create_callback_href(array($this, 'edit_rset'), array($t['id'])), 'edit');
         $table_name = $t['tab'];
         $table_href = $this->create_callback_href(array($this, 'manage_recordset'), array($table_name));
         $gbr->add_data("<a {$table_href}>{$table_name}</a>", Utils_RecordBrowserCommon::get_caption($t['tab']), str_replace(Utils_RecordBrowser_CustomRecordsetsCommon::$sep, ' -> ', $t['menu']));
     }
     Base_ActionBarCommon::add('new', __('Create new'), $this->create_callback_href(array($this, 'edit_rset')));
     $this->display_module($gb);
 }
Exemplo n.º 2
0
 public function edit_permissions($permission_name = null)
 {
     if ($this->is_back()) {
         Base_BoxCommon::pop_main();
     }
     Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
     Base_ThemeCommon::load_css('Base_Acl', 'edit_permissions');
     $gb = $this->init_module('Utils_GenericBrowser', 'acl_editor', 'acl_editor');
     $gb->set_table_columns(array(array('name' => '&nbsp;', 'width' => 20)));
     $sql = 'SELECT id, name FROM base_acl_permission';
     $args = array();
     $perm_id = null;
     if ($permission_name) {
         $sql .= ' WHERE name=%s';
         $args[] = $permission_name;
         $perm_id = DB::GetOne('SELECT id FROM base_acl_permission WHERE name=%s', array($permission_name));
     }
     $sql .= ' ORDER BY name ASC';
     $perms = DB::GetAssoc($sql, $args);
     Base_ActionBarCommon::add('add', __('Add rule'), $this->create_callback_href(array($this, 'edit_rule'), array(null, $perm_id)));
     foreach ($perms as $p_id => $p_name) {
         $gb_row = $gb->get_new_row();
         $gb_row->add_data(array('value' => _V($p_name), 'class' => 'Base_Acl__permission', 'attrs' => 'colspan="2"'));
         $gb_row->no_actions();
         $perms = DB::GetAssoc('SELECT id, id FROM base_acl_rules WHERE permission_id=%d', array($p_id));
         foreach ($perms as $r_id) {
             $clearances = DB::GetAssoc('SELECT id, clearance FROM base_acl_rules_clearance WHERE rule_id=%d', array($r_id));
             $gb_row = $gb->get_new_row();
             $gb_row->add_action($this->create_confirm_callback_href(__('Are you sure you want to delete this rule?'), array($this, 'delete_rule'), array($r_id)), 'delete', __('Delete Rule'));
             $gb_row->add_action($this->create_callback_href(array($this, 'edit_rule'), array($r_id, $p_id)), 'edit', __('Edit Rule'));
             $gb_row->add_data(Base_AclCommon::display_clearances($clearances));
         }
     }
     $this->display_module($gb);
     eval_js('base_acl__initialized = false;');
 }
Exemplo n.º 3
0
 public function account_manager($pushed_on_top = false)
 {
     if ($pushed_on_top) {
         if ($this->is_back()) {
             Base_BoxCommon::pop_main();
             return;
         }
         Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
     } else {
         Base_ActionBarCommon::add('back', __('Back'), $this->create_main_href('Base_User_Settings'));
     }
     $this->rb = $this->init_module('Utils/RecordBrowser', 'rc_accounts', 'rc_accounts');
     $this->rb->set_defaults(array('epesi_user' => Acl::get_user()));
     $order = array(array('login' => 'DESC'), array('epesi_user' => Acl::get_user()), array('epesi_user' => false));
     $this->display_module($this->rb, $order);
     // other settings
     $qf = $this->init_module('Libs/QuickForm');
     $qf->addElement('advcheckbox', 'standard_mailto', __("Use standard mailto links"), null, array('onchange' => $qf->get_submit_form_js()));
     $use_standard_mailto = CRM_RoundcubeCommon::use_standard_mailto();
     $qf->setDefaults(array('standard_mailto' => $use_standard_mailto));
     if ($qf->validate()) {
         CRM_RoundcubeCommon::set_standard_mailto($qf->exportValue('standard_mailto'));
     }
     $qf->display_as_row();
 }
Exemplo n.º 4
0
 public function no_ssl_settings()
 {
     $f = $this->init_module("Libs/QuickForm");
     $f->addElement('checkbox', 'allow', 'Allow unsecure connection');
     Base_ActionBarCommon::add('back', __('Back'), Base_BoxCommon::pop_main_href());
     Base_ActionBarCommon::add('save', __('Save'), $f->get_submit_form_href());
     if ($f->validate()) {
         $x = $f->exportValues();
         $allow = false;
         if (isset($x['allow']) && $x['allow']) {
             $allow = true;
         }
         Base_EssClientCommon::set_no_ssl_allow($allow);
         Base_BoxCommon::pop_main();
         return;
     }
     $f->setDefaults(array('allow' => Base_EssClientCommon::is_no_ssl_allowed()));
     print '<div class="important_notice">';
     print __('Allowing unsecure connection will cause all the data to be transferred without encryption. This creates opportunity for third parties to capture the data being transmitted, including your License Key. Please note that License Key should be kept confidential and that using the same License Key on several EPESI installations is a direct violation of Terms of Service and will result in termination of the License Key.');
     print '<center>';
     $f->display();
     print '</center>';
     print '</div>';
 }
Exemplo n.º 5
0
 public function change_email_header()
 {
     $adm = $this->init_module('Base_User_Administrator');
     $back = $adm->is_back();
     if ($back) {
         Base_BoxCommon::pop_main();
         return false;
     }
     $result = $this->display_module($adm, array(), 'change_email_header');
     print '<span style="display:none;">' . microtime(true) . '</span>';
     return true;
 }