protected function setUp()
 {
     global $CI, $modules, $communication;
     $CI =& get_instance();
     $CI->load->library('users/auth');
     $CI->auth->login("user", "pass", 1);
     $modules = new modules();
     $communication = $modules->load('communication/content');
     $communication->load->model('communication/communication_model');
 }
Exemple #2
0
 public function mid()
 {
     if ($this->module_alias) {
         $method = $this->uri->segment(4, 'index');
         echo modules::run($this->module_alias . '/' . $method);
     }
 }
Exemple #3
0
 function index()
 {
     // $enemigos= $this->load->module('enemigos');
     // $load['enemigos']= $enemigos->listar();
     $load['enemigos'] = modules::run('enemigos/enemigos/listar', 'Amigos');
     $this->load->view('saludo', $load);
 }
 function __construct()
 {
     parent::__construct();
     $this->load->library('session');
     $this->load->helper('url');
     $user_id = $this->session->userdata('user_id');
     if (!$user_id) {
         redirect('sessions/login');
     }
     if (!isset(self::$is_loaded)) {
         self::$is_loaded = TRUE;
         $this->load->config('mcb_menu/mcb_menu');
         modules::run('mcb_menu/check_permission', $this->uri->uri_string(), $this->session->userdata('global_admin'));
         $this->load->database();
         $this->load->helper(array('uri', 'mcb_currency', 'mcb_invoice', 'mcb_date', 'mcb_icon', 'mcb_custom', 'mcb_app', 'mcb_invoice_amount', 'mcb_invoice_item', 'mcb_invoice_payment', 'mcb_numbers'));
         $this->load->model(array('mcb_modules/mdl_mcb_modules', 'mcb_data/mdl_mcb_data', 'mcb_data/mdl_mcb_userdata'));
         $this->mdl_mcb_modules->set_module_data();
         $this->mdl_mcb_data->set_session_data();
         $this->mdl_mcb_userdata->set_session_data($user_id);
         $this->mdl_mcb_modules->load_custom_languages();
         $this->load->language('mcb', $this->mdl_mcb_data->setting('default_language'));
         $this->load->model('fields/mdl_fields');
         $this->load->library(array('form_validation', 'redir'));
         $this->form_validation->set_error_delimiters('<div class="error">', '</div>');
         if ($this->mdl_mcb_data->setting('enable_profiler')) {
             $this->output->enable_profiler();
         }
     }
 }
 public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
 {
     // first we need to check if this is called before CI_controller
     // if yes, well just use default
     if (!class_exists('CI_controller')) {
         return parent::load($file, $use_sections, $fail_gracefully);
     }
     if (in_array($file, $this->is_loaded, TRUE)) {
         return $this->item($file);
     }
     $_module = Modules::$current;
     if ($path = modules::find($file, $_module, 'config')) {
         // this file expected contain $config var
         include $path;
         if (!isset($config) or !is_array($config)) {
             show_error("{$path} does not contain a valid config array");
         }
         log_message('debug', "File loaded: {$path}");
         $current_config =& $this->config;
         if ($use_sections === TRUE) {
             if (isset($current_config[$file])) {
                 $current_config[$file] = array_merge($current_config[$file], $config);
             } else {
                 $current_config[$file] = $config;
             }
         } else {
             $current_config = array_merge($current_config, $config);
         }
         $this->is_loaded[] = $file;
         unset($config);
         return $this->item($file);
     }
     return parent::load($file, $use_sections, $fail_gracefully);
 }
Exemple #6
0
    public function render($label_template = '{title}', $back_url = NULL)
    {
        if (empty($this->mItems)) {
            return '<p>No records are found.</p>';
        } else {
            $html = modules::run('adminlte/widget/box_open', 'Sort Order', 'primary');
            // Render form with alert message
            $html .= '<form action="' . current_full_url() . '" method="POST">';
            $html .= $this->CI->system_message->render();
            $html .= '<p>Drag and drop below items to sort them in ascending order:</p>';
            // Generate item list by CodeIgniter Template Parser
            $template = '<ul class="sortable list-group">
				{items}
				<li class="list-group-item">
					<strong>' . $label_template . '</strong>
					<input type="hidden" name="' . $this->mPostName . '[]" value="{id}" />
				</li>
				{/items}
			</ul>';
            $data = array('items' => $this->mItems);
            $html .= $this->CI->parser->parse_string($template, $data, TRUE);
            if ($back_url != NULL) {
                $html .= modules::run('adminlte/widget/btn', 'Back', $back_url, 'reply', 'bg-purple') . ' ';
            }
            $html .= modules::run('adminlte/widget/btn_submit', 'Save');
            $html .= '</form>';
            $html .= modules::run('adminlte/widget/box_close');
            return $html;
        }
    }
Exemple #7
0
 public function modload()
 {
     modules::init_module('cs_levels', self::MOD_VERSION, self::MOD_AUTHOR, 'chanserv', 'default');
     // these are standard in module constructors
     chanserv::add_help('cs_levels', 'help', &chanserv::$help->CS_HELP_LEVELS_1);
     // add the help
     if (ircd::$halfop) {
         chanserv::add_help('cs_levels', 'help levels', &chanserv::$help->CS_HELP_LEVELS_ALL);
     } else {
         chanserv::add_help('cs_levels', 'help levels', &chanserv::$help->CS_HELP_LEVELS_ALL2);
     }
     // if we have halfop enabled the help we add is different.
     chanserv::add_command('levels', 'cs_levels', 'levels_command');
     // add the command
     self::$flags = '+-kvhoaqsrftFb';
     // string of valid flags
     if (!ircd::$halfop) {
         self::$flags = str_replace('h', '', self::$flags);
     }
     // if halfop isnt enabled, remove h and H
     if (!ircd::$protect) {
         self::$flags = str_replace('a', '', self::$flags);
     }
     // same for protect
     if (!ircd::$owner) {
         self::$flags = str_replace('q', '', self::$flags);
     }
     // and finally, owner
 }
 public function load($langfile, $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '')
 {
     // first we need to check if this is called before CI_controller
     // if yes, well just use default
     if (!class_exists('CI_controller')) {
         return parent::load($file, $use_sections, $fail_gracefully);
     }
     if (is_array($langfile)) {
         foreach ($langfile as $_lang) {
             $this->load($_lang);
         }
         return $this->language;
     }
     $deft_lang = get_instance()->config->item('language');
     $idiom or $idiom = $deft_lang;
     if (in_array($langfile . '_lang.php', $this->is_loaded, TRUE)) {
         return $this->language;
     }
     $_module = get_instance()->router->fetch_module();
     if ($path = modules::find($langfile . '_lang', $_module, 'language/' . $idiom)) {
         include $path;
         if (!isset($lang) or !is_array($lang)) {
             show_error("{$path} does not contain a valid lang array");
         }
         if ($return) {
             return $lang;
         }
         $this->language = array_merge($this->language, $lang);
         $this->is_loaded[] = $langfile . '_lang.php';
         unset($lang);
         return $this->language;
     }
     return parent::load($langfile, $idiom, $return, $add_suffix, $alt_path);
 }
Exemple #9
0
 private function show($view, $user_data)
 {
     $this->load->helper('form');
     $view_data['user'] = $user_data;
     $view_data['status'] = array(0 => lang('user.status0'), 1 => lang('user.status1'));
     $view_data['permissions'] = modules::run('permission/get_permissions_dropdown');
     return $this->load->view($view . '.php', $view_data, true);
 }
Exemple #10
0
 public function blog_category()
 {
     $crud = $this->generate_crud('demo_blog_categories');
     $crud->columns('title');
     $this->mTitle .= 'Blog Categories';
     $this->mViewData['crud_note'] = modules::run('adminlte/widget/btn', 'Sort Order', 'demo/blog_category_sortable');
     $this->render_crud();
 }
Exemple #11
0
 public function modload()
 {
     modules::init_module('ns_help', self::MOD_VERSION, self::MOD_AUTHOR, 'nickserv', 'static');
     // these are standard in module constructors
     nickserv::add_help_fix('ns_help', 'prefix', 'help', &nickserv::$help->NS_HELP_PREFIX);
     nickserv::add_help_fix('ns_help', 'suffix', 'help', &nickserv::$help->NS_HELP_SUFFIX);
     // add teh help docs
 }
Exemple #12
0
 function _custom_save()
 {
     foreach ($this->mdl_mcb_modules->custom_modules as $module) {
         if ($module->module_enabled and isset($module->module_config['settings_save'])) {
             modules::run($module->module_config['settings_save']);
         }
     }
 }
Exemple #13
0
 function show_widgets()
 {
     foreach ($this->mdl_mcb_modules->custom_modules as $module) {
         if ($module->module_enabled and isset($module->module_config['dashboard_widget'])) {
             echo modules::run($module->module_config['dashboard_widget']);
         }
     }
 }
Exemple #14
0
 function login()
 {
     $data['title'] = "Login";
     //validate form input
     $this->form_validation->set_rules('identity', 'Identity', 'required');
     $this->form_validation->set_rules('password', 'Password', 'required');
     if ($this->form_validation->run() == true) {
         //cek pertama login pengguna dengan loading M_user di tb_pengguna
         if ($this->ion_auth->cek_first($this->input->post('identity'), $this->input->post('password')) == TRUE) {
             //buat akun dengan email dan password ini
             //load M_user
             $this->load->model('M_user');
             $pengguna = $this->M_user->get_user_by_email($this->input->post('identity'));
             $username = $pengguna->username;
             $email = $pengguna->email;
             $password = $pengguna->password;
             $additional_data = array('pengguna_id' => $pengguna->pengguna_id);
             //kalo sudah ada pengguna_id di tb_auth_user
             //maka cukup update datanya saja....
             $auth_user = $this->M_user->get_user_by_pengguna_id_auth_user($pengguna->pengguna_id);
             if ($auth_user == TRUE) {
                 if ($auth_user->email != $pengguna->email) {
                     $this->ion_auth->update($auth_user->id, $data);
                 }
             } else {
                 $this->session->set_userdata('email', $pengguna->email);
                 //go to login pertama pengelola
                 modules::run('redirection');
             }
             //then form masukkan kordinat dilengkapi dengan nama profil sekolah.
         } else {
             //check to see if the user is logging in
             //check for "remember me"
             $remember = (bool) $this->input->post('remember');
             if ($this->ion_auth->login($this->input->post('identity'), $this->input->post('password'), $remember)) {
                 //if the login is successful
                 //redirect them back to the home page
                 $this->session->set_flashdata('message', $this->ion_auth->messages());
                 modules::run('redirection/cek_group');
                 // redirect('admin', 'refresh');
             } else {
                 //if the login was un-successful
                 //redirect them back to the login page
                 $this->session->set_flashdata('message', $this->ion_auth->errors());
                 redirect('auth/login', 'refresh');
                 //use redirects instead of loading views for compatibility with MY_Controller libraries
             }
         }
     } else {
         //the user is not logging in so display the login page
         //set the flash data error message if there is one
         $data['message'] = validation_errors() ? validation_errors() : $this->session->flashdata('message');
         $data['identity'] = array('name' => 'identity', 'id' => 'identity', 'type' => 'text', 'value' => $this->form_validation->set_value('identity'));
         $data['password'] = array('name' => 'password', 'id' => 'password', 'type' => 'password');
         $this->template->set('title', 'Login Form');
         $this->template->load($this->_template . 'login', 'content/V_login', $data);
     }
 }
Exemple #15
0
 public static function rehash_command($nick, $ircdata = array())
 {
     $parser = new parser(CONFPATH . 'services.conf');
     // load the parser
     $total_modules_exceptions = array();
     $mod_info = array('cs' => 'chanserv', 'ns' => 'nickserv', 'os' => 'operserv', 'core' => 'core');
     foreach ($mod_info as $short => $full) {
         $category_name = $full . '_modules';
         foreach (core::$config->{$category_name} as $id => $module) {
             $total_modules[$short . '_' . $module] = array('type' => $short, 'file' => $module . '.' . $short . '.php');
         }
     }
     // merge all the arrays to check that the loaded and excluded modules are all correct
     foreach (modules::$list as $name => $details) {
         if (!isset($total_modules[$name]) && $details['extra'] != 'static') {
             if (is_callable(array($name, 'modunload'), true) && method_exists($name, 'modunload')) {
                 modules::$list[$name]['class']->modunload();
             }
             // if the module has an unload method, call it now before we destroy the class.
             unset(modules::$list[$name]);
             modules::_unset_docs($name);
             // destory relevant data to the module
             core::alog(core::$config->operserv->nick . ': unloaded module ' . $name);
             ircd::globops(core::$config->operserv->nick, 'unloaded module ' . $name);
             // unset the module
             core::alog('rehash_command(): ' . $name . ' unloaded from rehash', 'BASIC');
             // log what we need to log.
         }
         // the module is loaded and should be unloaded
     }
     // go through each set module and unset the now exempt modules
     foreach ($total_modules as $name => $details) {
         if (!isset(modules::$list[$name])) {
             if (!class_exists($name)) {
                 modules::load_module($name, $details['file']);
                 // load the module
             } else {
                 if (!(modules::$list[$name]['class'] = new $name())) {
                     core::alog('load_module(): unable to start: ' . $name . ' (boot error)', 'BASIC');
                     return false;
                 }
             }
             core::alog(core::$config->operserv->nick . ': loaded module ' . $name);
             ircd::globops(core::$config->operserv->nick, 'loaded module ' . $name);
             // load it up
             core::alog('rehash_command(): ' . $name . ' loaded from rehash', 'BASIC');
             // log what we need to log.
             modules::$list[$name]['class']->modload();
             // onload handler.
         }
     }
     // go through every module
     // load the ones that are new.
     core::alog(core::$config->operserv->nick . ': Successfully reloaded configuration.');
     ircd::globops(core::$config->operserv->nick, $nick . ' performed a REHASH');
     core::alog('rehash_command(): sucessful rehash', 'BASIC');
     // log what we need to log.
 }
Exemple #16
0
 public function admincp_index()
 {
     modules::run('admincp/chk_perm', $this->session->userdata('ID_Module'), 'r', 0);
     $default_func = 'created';
     $default_sort = 'DESC';
     $data = array('module' => $this->module, 'module_name' => $this->session->userdata('Name_Module'), 'default_func' => $default_func, 'default_sort' => $default_sort);
     $this->template->write_view('content', 'index', $data);
     $this->template->render();
 }
Exemple #17
0
 public function empcontract()
 {
     $url = url();
     $content['header_tags'] = '<link rel="stylesheet" href="' . $url . 'visaappres/css/font-awesome.min.css">
     <link rel="stylesheet" href="' . $url . 'visaappres/css/bootstrap.min.css">
     <link rel="stylesheet" href="' . $url . 'visaappres/css/main.css">';
     $content['content'] = $this->load->view('empcontract', '', TRUE);
     echo modules::run('_main/render', $content);
 }
Exemple #18
0
 function index()
 {
     $seg1 = $this->uri->segment(3);
     $seg2 = $this->uri->segment(4) ? $this->uri->segment(4) : 'index';
     // $enemigos= $this->load->module('enemigos');
     // $load['enemigos']= $enemigos->listar();
     $load['enemigos'] = modules::run('$seg1/$seg1/$seg2');
     $this->load->view('saludo', $load);
 }
Exemple #19
0
 public function index()
 {
     if ($this->session->userdata('user_id') == '') {
         header('Location: ' . url('login'));
     } else {
         $content['content'] = $this->load->view('home', '', TRUE);
         echo modules::run('_main/render', $content);
     }
 }
Exemple #20
0
 public function modload()
 {
     modules::init_module('ns_ghost', self::MOD_VERSION, self::MOD_AUTHOR, 'nickserv', 'default');
     // these are standard in module constructors
     nickserv::add_help('ns_ghost', 'help', &nickserv::$help->NS_HELP_GHOST_1);
     nickserv::add_help('ns_ghost', 'help ghost', &nickserv::$help->NS_HELP_GHOST_ALL);
     // add the help
     nickserv::add_command('ghost', 'ns_ghost', 'ghost_command');
     // add the ghost command
 }
Exemple #21
0
 public function modload()
 {
     modules::init_module('os_vhost', self::MOD_VERSION, self::MOD_AUTHOR, 'operserv', 'static');
     // these are standard in module constructors
     operserv::add_help('os_vhost', 'help', &operserv::$help->OS_HELP_VHOST_1);
     operserv::add_help('os_vhost', 'help vhost', &operserv::$help->OS_HELP_VHOST_ALL);
     // add the help
     operserv::add_command('vhost', 'os_vhost', 'vhost_command');
     // add the vhost command
 }
 public function modload()
 {
     modules::init_module('os_chanclear', self::MOD_VERSION, self::MOD_AUTHOR, 'operserv', 'default');
     // these are standard in module constructors
     operserv::add_help('os_chanclear', 'help', &operserv::$help->OS_HELP_CHANCLEAR_1);
     operserv::add_help('os_chanclear', 'help chanclear', &operserv::$help->OS_HELP_CHANCLEAR_ALL);
     // add the help
     operserv::add_command('chanclear', 'os_chanclear', 'chanclear_command');
     // add the command
 }
Exemple #23
0
 public function modload()
 {
     modules::init_module('os_stats', self::MOD_VERSION, self::MOD_AUTHOR, 'operserv', 'default');
     // these are standard in module constructors
     operserv::add_help('os_stats', 'help', &operserv::$help->OS_HELP_STATS_1);
     operserv::add_help('os_stats', 'help stats', &operserv::$help->OS_HELP_STATS_ALL);
     // add the help
     operserv::add_command('stats', 'os_stats', 'stats_command');
     // add the stats command
 }
Exemple #24
0
 public function modload()
 {
     modules::init_module('cs_drop', self::MOD_VERSION, self::MOD_AUTHOR, 'chanserv', 'default');
     // these are standard in module constructors
     chanserv::add_help('cs_drop', 'help', &chanserv::$help->CS_HELP_DROP_1);
     chanserv::add_help('cs_drop', 'help drop', &chanserv::$help->CS_HELP_DROP_ALL);
     // add the help
     chanserv::add_command('drop', 'cs_drop', 'drop_command');
     // add the drop command
 }
Exemple #25
0
 public function modload()
 {
     modules::init_module('ns_info', self::MOD_VERSION, self::MOD_AUTHOR, 'nickserv', 'default');
     // these are standard in module constructors
     nickserv::add_help('ns_info', 'help', &nickserv::$help->NS_HELP_INFO_1);
     nickserv::add_help('ns_info', 'help info', &nickserv::$help->NS_HELP_INFO_ALL);
     // add the help
     nickserv::add_command('info', 'ns_info', 'info_command');
     // add the info command
 }
Exemple #26
0
 public function modload()
 {
     modules::init_module('os_ignore', self::MOD_VERSION, self::MOD_AUTHOR, 'operserv', 'default');
     // these are standard in module constructors
     operserv::add_help('os_ignore', 'help', &operserv::$help->OS_HELP_IGNORE_1);
     operserv::add_help('os_ignore', 'help ignore', &operserv::$help->OS_HELP_IGNORE_ALL);
     // add the help
     operserv::add_command('ignore', 'os_ignore', 'ignore_command');
     // add the ignore command
 }
Exemple #27
0
 public function modload()
 {
     modules::init_module('cs_topic', self::MOD_VERSION, self::MOD_AUTHOR, 'chanserv', 'default');
     // these are standard in module constructors
     chanserv::add_help('cs_topic', 'help commands', &chanserv::$help->CS_HELP_TOPIC_1);
     chanserv::add_help('cs_topic', 'help topic', &chanserv::$help->CS_HELP_TOPIC_ALL);
     // add the help
     chanserv::add_command('topic', 'cs_topic', 'topic_command');
     // add the commands
 }
Exemple #28
0
 public function modload()
 {
     modules::init_module('cs_list', self::MOD_VERSION, self::MOD_AUTHOR, 'chanserv', 'default');
     // these are standard in module constructors
     chanserv::add_help('cs_list', 'help', &chanserv::$help->CS_HELP_LIST_1, true);
     chanserv::add_help('cs_list', 'help list', &chanserv::$help->CS_HELP_LIST_ALL, true);
     // add the help
     chanserv::add_command('list', 'cs_list', 'list_command');
     // add the list command
 }
 public function modload()
 {
     modules::init_module('cs_register', self::MOD_VERSION, self::MOD_AUTHOR, 'chanserv', 'default');
     // these are standard in module constructors
     chanserv::add_help('cs_register', 'help', &chanserv::$help->CS_HELP_REGISTER_1);
     chanserv::add_help('cs_register', 'help register', &chanserv::$help->CS_HELP_REGISTER_ALL);
     // add the help
     chanserv::add_command('register', 'cs_register', 'register_command');
     // add the command
 }
Exemple #30
0
	public function index()
	{
		modules::run('general/is_logged', base_url().'index.php/usuarios/iniciar-sesion');
		$data['main_content'] = $this->load->view('home_view','',TRUE);

		//Cargando la lista de menus del sidebar genérica (se puede puede personalizar, ver ejemplo
		//en el controlador de modules/utilities/utils.php) 
		$l = $this->utils->list_sidebar();
		$this->utils->template($l,'home/home_view','','','',
			'two_level');
	}