예제 #1
0
 function __construct()
 {
     parent::__construct();
     \CI::auth()->check_access('Admin', true);
     \CI::lang()->load('categories');
     \CI::load()->model('Categories');
 }
예제 #2
0
 public function __construct()
 {
     parent::__construct();
     \CI::auth()->check_access('Admin', true);
     \CI::load()->model('Locations');
     \CI::lang()->load('locations');
 }
예제 #3
0
 public function logout()
 {
     \CI::auth()->logout();
     //when someone logs out, automatically redirect them to the login page.
     \CI::session()->set_flashdata('message', lang('message_logged_out'));
     redirect('admin/login');
 }
예제 #4
0
 public function __construct()
 {
     parent::__construct();
     \CI::auth()->check_access('Admin', true);
     \CI::load()->model(['Categories', 'Products', 'Pages']);
     \CI::lang()->load('sitemap');
 }
예제 #5
0
 public function __construct()
 {
     parent::__construct();
     \CI::auth()->check_access('Admin', true);
     \CI::load()->model(['Messages', 'Pages', 'Locations']);
     \CI::lang()->load('settings');
     \CI::load()->helper('inflector');
 }
예제 #6
0
 public function __construct()
 {
     parent::__construct();
     \CI::auth()->check_access('Admin', true);
     \CI::load()->model('Coupons');
     \CI::load()->model('products');
     \CI::lang()->load('coupons');
 }
예제 #7
0
 function __construct()
 {
     parent::__construct();
     \CI::auth()->check_access('Admin', true);
     \CI::load()->model(['Orders', 'Search']);
     \CI::load()->helper(array('formatting'));
     \CI::lang()->load('reports');
 }
예제 #8
0
 public function __construct()
 {
     parent::__construct();
     \CI::auth()->check_access('Admin', true);
     \CI::load()->model(['Products', 'Categories']);
     \CI::load()->helper('form');
     \CI::lang()->load('products');
 }
예제 #9
0
 public function __construct()
 {
     parent::__construct();
     if (\CI::auth()->check_access('Orders')) {
         redirect(config_item('admin_folder') . '/orders');
     }
     \CI::load()->model('Orders');
     \CI::load()->model('Customers');
     \CI::load()->helper('date');
     \CI::lang()->load('dashboard');
 }
예제 #10
0
 public function __construct()
 {
     parent::__construct();
     \CI::auth()->check_access('Admin', true);
     \CI::load()->model(['Products', 'Categories']);
     \CI::load()->helper('form');
     \CI::lang()->load('products');
     //$engines = \CI::Products()->getProductsCondition(1,60);
     //$alternator = \CI::Products()->getProductsAlternators(2,60);
     //echo \CI::db()->last_query().'<pre>';print_r($alternator);exit;
 }
예제 #11
0
 public function index()
 {
     \CI::auth()->check_access('Admin', true);
     \CI::lang()->load('settings');
     \CI::load()->helper('inflector');
     global $shippingModules;
     $data['shipping_modules'] = $shippingModules;
     $data['enabled_modules'] = \CI::Settings()->get_settings('shipping_modules');
     $data['page_title'] = lang('common_shipping_modules');
     $this->view('shipping_index', $data);
 }
예제 #12
0
 public function index()
 {
     \CI::auth()->check_access('Admin', true);
     \CI::lang()->load('settings');
     \CI::load()->helper('inflector');
     global $paymentModules;
     //Payment Information
     $payment_order = \CI::Settings()->get_settings('payment_order');
     $data['payment_modules'] = $paymentModules;
     $data['enabled_modules'] = \CI::Settings()->get_settings('payment_modules');
     $data['page_title'] = lang('common_payment_modules');
     $this->view('payment_index', $data);
 }
예제 #13
0
 public function __construct()
 {
     parent::__construct();
     \CI::auth()->check_access('Admin', true);
     \CI::lang()->load('cod');
 }
예제 #14
0
 public function __construct()
 {
     parent::__construct();
     \CI::lang()->load('admin_common');
     \CI::auth()->isLoggedIn(uri_string());
 }
예제 #15
0
                                <li><a href="<?php 
        echo site_url('admin/gift-cards');
        ?>
"><?php 
        echo lang('common_gift_cards');
        ?>
</a></li>
                            <?php 
    }
    ?>
                        </ul>
                    </li>

                    <?php 
    // Restrict access to Admins only
    if (CI::auth()->check_access('Admin')) {
        ?>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><?php 
        echo lang('common_catalog');
        ?>
 <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="<?php 
        echo site_url('admin/categories');
        ?>
"><?php 
        echo lang('common_categories');
        ?>
</a></li>
                            <li><a href="<?php 
예제 #16
0
 public function edit_status()
 {
     \CI::auth()->isLoggedIn();
     $order['id'] = \CI::input()->post('id');
     $order['status'] = \CI::input()->post('status');
     \CI::Orders()->saveOrder($order);
     echo url_title($order['status']);
 }
예제 #17
0
 public function form($id = false)
 {
     \CI::load()->helper('form');
     \CI::load()->library('form_validation');
     \CI::form_validation()->set_error_delimiters('<div class="error">', '</div>');
     $data['page_title'] = lang('admin_form');
     //default values are empty if the customer is new
     $data['id'] = '';
     $data['firstname'] = '';
     $data['lastname'] = '';
     $data['email'] = '';
     $data['username'] = '';
     $data['access'] = '';
     if ($id) {
         $this->admin_id = $id;
         $admin = \CI::auth()->getAdmin($id);
         //if the administrator does not exist, redirect them to the admin list with an error
         if (!$admin) {
             \CI::session()->set_flashdata('message', lang('admin_not_found'));
             redirect('admin/users');
         }
         //set values to db values
         $data['id'] = $admin->id;
         $data['firstname'] = $admin->firstname;
         $data['lastname'] = $admin->lastname;
         $data['email'] = $admin->email;
         $data['username'] = $admin->username;
         $data['access'] = $admin->access;
     }
     \CI::form_validation()->set_rules('firstname', 'lang:firstname', 'trim|max_length[32]');
     \CI::form_validation()->set_rules('lastname', 'lang:lastname', 'trim|max_length[32]');
     \CI::form_validation()->set_rules('email', 'lang:email', 'trim|required|valid_email|max_length[128]');
     \CI::form_validation()->set_rules('username', 'lang:username', ['trim', 'required', 'max_length[128]', ['username_callable', function ($str) {
         $email = \CI::auth()->check_username($str, $this->admin_id);
         if ($email) {
             \CI::form_validation()->set_message('username_callable', lang('error_username_taken'));
             return FALSE;
         } else {
             return TRUE;
         }
     }]]);
     \CI::form_validation()->set_rules('access', 'lang:access', 'trim|required');
     //if this is a new account require a password, or if they have entered either a password or a password confirmation
     if (\CI::input()->post('password') != '' || \CI::input()->post('confirm') != '' || !$id) {
         \CI::form_validation()->set_rules('password', 'lang:password', 'required|min_length[6]|sha1');
         \CI::form_validation()->set_rules('confirm', 'lang:confirm_password', 'required|sha1|matches[password]');
     }
     if (\CI::form_validation()->run() == FALSE) {
         $this->view('user_form', $data);
     } else {
         $save['id'] = $id;
         $save['firstname'] = \CI::input()->post('firstname');
         $save['lastname'] = \CI::input()->post('lastname');
         $save['email'] = \CI::input()->post('email');
         $save['username'] = \CI::input()->post('username');
         $save['access'] = \CI::input()->post('access');
         if (\CI::input()->post('password') != '' || !$id) {
             $save['password'] = \CI::input()->post('password');
         }
         \CI::auth()->save($save);
         \CI::session()->set_flashdata('message', lang('message_user_saved'));
         //go back to the customer list
         redirect('admin/users');
     }
 }