Example #1
1
 /**
  * Allows loading from a specified directory instead of DIR_APPLICATION
  *
  * @param $model
  * @param $directory
  * @throws Exception when file was not found
  */
 private function modelFromDirectory($model, $directory)
 {
     if (!$directory) {
         $directory = DIR_APPLICATION;
     }
     $file = $directory . '/model/' . $model . '.php';
     $class = 'Model' . preg_replace('/[^a-zA-Z0-9]/', '', $model);
     if (file_exists($file)) {
         if (class_exists('VQMod')) {
             include_once VQMod::modCheck(modification($file), $file);
         } else {
             include_once $file;
         }
         $this->registry->set('model_' . str_replace('/', '_', $model), new $class($this->registry));
     } else {
         throw new Exception('Model not found', 404);
     }
 }
function autoload($class)
{
    $file = DIR_SYSTEM . 'library/' . str_replace('\\', '/', strtolower($class)) . '.php';
    if (is_file($file)) {
        include_once VQMod::modCheck(modification($file), $file);
        return true;
    }
    return false;
}
Example #3
0
function library($class)
{
    $file = DIR_SYSTEM . 'library/' . str_replace('\\', '/', strtolower($class)) . '.php';
    if (is_file($file)) {
        include_once modification($file);
        return true;
    } else {
        return false;
    }
}
 public function helper($helper)
 {
     $file = DIR_SYSTEM . 'helper/' . str_replace('../', '', (string) $helper) . '.php';
     if (file_exists($file)) {
         include_once VQMod::modCheck(modification($file), $file);
     } else {
         trigger_error('Error: Could not load helper ' . $file . '!');
         exit;
     }
 }
Example #5
0
function autoload($class)
{
    $file = DIR_SYSTEM . 'library/' . str_replace('\\', '/', strtolower($class)) . '.php';
    if (file_exists($file)) {
        include modification($file);
        return true;
    } else {
        return false;
    }
}
Example #6
0
 public function helper($helper)
 {
     $file = DIR_SYSTEM . 'helper/' . $helper . '.php';
     if (file_exists($file)) {
         include_once modification($file);
     } else {
         trigger_error('Error: Could not load helper ' . $file . '!');
         exit;
     }
 }
Example #7
0
 public function getVisits()
 {
     require_once modification(DIR_SYSTEM . 'library/google-apps/Client.php');
     require_once modification(DIR_SYSTEM . 'library/google-apps/autoload.php');
     $client = new Google_Client();
     $client->setApplicationName("conect-analycts-irroba");
     $client->setDeveloperKey("AIzaSyChTrzm8478VMmKSFW1ImuJfZYnaNdwLyc");
     $analytcs = new Google_Service_Analytics($client);
     $metrics = array('ga:pageviews');
     exit(print_r($analytcs->data_realtime->get('ga:99821030', '2015-04-01', '2015-04-15', $metrics, $optParams = array())));
 }
Example #8
0
 /**
  * @param string $filename
  */
 public function load($filename)
 {
     $file = DIR_CONFIG . $filename . '.php';
     if (file_exists($file)) {
         $_ = array();
         require modification($file);
         $this->data = array_merge($this->data, $_);
     } else {
         trigger_error('Error: Could not load config ' . $filename . '!');
         exit;
     }
 }
Example #9
0
 public function load($filename)
 {
     $_ = array();
     $files = array(DIR_LANGUAGE . $this->default . '/' . $filename . '.php', DIR_LANGUAGE . $this->directory . '/' . 'default.php', DIR_LANGUAGE . $this->directory . '/' . $filename . '.php');
     foreach ($files as $file) {
         if (file_exists($file)) {
             require modification($file);
         }
     }
     $this->data = array_merge($this->data, $_);
     return $this->data;
 }
Example #10
0
function autoload($class)
{
    $lib = DIR_SYSTEM . 'library/' . str_replace('\\', '/', strtolower($class)) . '.php';
    $app = DIR_SYSTEM . 'library/app/' . str_replace('\\', '/', strtolower($class)) . '.php';
    if (is_file($lib)) {
        include modification($lib);
        return true;
    } elseif (is_file($app)) {
        include modification($app);
        return true;
    }
    return false;
}
Example #11
0
 public function load($filename)
 {
     $_ = array();
     $file = DIR_LANGUAGE . $this->default . '/' . $filename . '.php';
     if (file_exists($file)) {
         require modification($file);
     }
     $file = DIR_LANGUAGE . $this->directory . '/' . $filename . '.php';
     if (file_exists($file)) {
         require modification($file);
     }
     $this->data = array_merge($this->data, $_);
     return $this->data;
 }
Example #12
0
 public function load($filename)
 {
     if (defined('HTTP_CATALOG') && version_compare(VERSION, '2.1', '>=') && strpos($filename, 'sale/custom') === 0) {
         $filename = substr_replace($filename, 'customer', 0, 4);
     }
     //+mod by yp
     $_ = array();
     $file = DIR_LANGUAGE . $this->default . '/' . $filename . '.php';
     if (file_exists($file)) {
         require modification($file);
     }
     $file = DIR_LANGUAGE . $this->directory . '/' . $filename . '.php';
     if (file_exists($file)) {
         require modification($file);
     }
     $this->data = array_merge($this->data, $_);
     return $this->data;
 }
Example #13
0
 public function execute($registry)
 {
     // Stop any magical methods being called
     if (substr($this->method, 0, 2) == '__') {
         return false;
     }
     if (is_file($this->file)) {
         include_once modification($this->file);
         $class = $this->class;
         $controller = new $class($registry);
         if (is_callable(array($controller, $this->method))) {
             return call_user_func(array($controller, $this->method), $this->args);
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
Example #14
0
 public function override($filename)
 {
     $_ = array();
     $file = Client::getDir() . 'language/' . 'override/' . $this->directory . '/' . $filename . '.php';
     if (file_exists($file)) {
         require modification($file);
     }
     $this->data = array_merge($this->data, $_);
     return $this->data;
 }
Example #15
0
 public function index()
 {
     $this->document->setPage('login');
     require_once modification(DIR_SYSTEM . 'library/google_api/Google_Client.php');
     require_once modification(DIR_SYSTEM . 'library/google_api/contrib/Google_Oauth2Service.php');
     if ($this->request->server['HTTPS']) {
         $server = $this->config->get('config_ssl');
     } else {
         $server = $this->config->get('config_url');
     }
     $this->load->model('account/customer');
     // Login override for admin users
     if (!empty($this->request->get['token'])) {
         $this->event->trigger('pre.customer.login');
         $this->customer->logout();
         $this->cart->clear();
         unset($this->session->data['wishlist']);
         unset($this->session->data['payment_address']);
         unset($this->session->data['payment_method']);
         unset($this->session->data['payment_methods']);
         unset($this->session->data['shipping_address']);
         unset($this->session->data['shipping_method']);
         unset($this->session->data['shipping_methods']);
         unset($this->session->data['comment']);
         unset($this->session->data['order_id']);
         unset($this->session->data['coupon']);
         unset($this->session->data['reward']);
         unset($this->session->data['voucher']);
         unset($this->session->data['vouchers']);
         $customer_info = $this->model_account_customer->getCustomerByToken($this->request->get['token']);
         if ($customer_info && $this->customer->login($customer_info['email'], '', true)) {
             // Default Addresses
             $this->load->model('account/address');
             if ($this->config->get('config_tax_customer') == 'payment') {
                 $this->session->data['payment_address'] = $this->model_account_address->getAddress($this->customer->getAddressId());
             }
             $this->session->data['login_aps'] = true;
             if ($this->config->get('config_tax_customer') == 'shipping') {
                 $this->session->data['shipping_address'] = $this->model_account_address->getAddress($this->customer->getAddressId());
             }
             $this->event->trigger('post.customer.login');
             $this->response->redirect($server . URL_ACCOUNT);
         }
     }
     if (!$this->request->server['HTTPS'] && $this->config->get('config_secure')) {
         $this->response->redirect(HTTPS_SERVER . URL_LOGIN);
     }
     if ($this->customer->isLogged()) {
         if ($this->cart->hasProducts()) {
             $minimum_purchase = $this->cart->hasMinimumPurchase();
             if ($minimum_purchase && (isset($minimum_purchase['requirements']) && !$minimum_purchase['requirements'])) {
                 $this->response->redirect($server . URL_CART);
             } else {
                 if (isset($this->session->data['recovered']) && $this->session->data['recovered']) {
                     $this->response->redirect($server . URL_CART);
                 } else {
                     $this->response->redirect($server . URL_CHECKOUT);
                 }
             }
         } else {
             $this->response->redirect($server . URL_ACCOUNT);
         }
     }
     // Add to activity log
     $this->load->model('account/activity');
     $this->load->language('account/login');
     $this->document->setTitle($this->language->get('heading_title'));
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate()) {
         unset($this->session->data['guest']);
         unset($this->session->data['login_register']);
         // Default Shipping Address
         $this->load->model('account/address');
         if ($this->config->get('config_tax_customer') == 'payment') {
             $this->session->data['payment_address'] = $this->model_account_address->getAddress($this->customer->getAddressId());
         }
         if ($this->config->get('config_tax_customer') == 'shipping') {
             $this->session->data['shipping_address'] = $this->model_account_address->getAddress($this->customer->getAddressId());
         }
         $activity_data = array('customer_id' => $this->customer->getId(), 'name' => $this->customer->getFirstName() . ' ' . $this->customer->getLastName());
         $this->model_account_activity->addActivity('login', $activity_data);
         if ($this->cart->hasProducts()) {
             $this->session->data['login_register'] = true;
             $minimum_purchase = $this->cart->hasMinimumPurchase();
             if ($minimum_purchase && (isset($minimum_purchase['requirements']) && !$minimum_purchase['requirements'])) {
                 $this->response->redirect($server . URL_CART);
             } else {
                 if (isset($this->session->data['recovered']) && $this->session->data['recovered']) {
                     $this->response->redirect($server . URL_CART);
                 } else {
                     $this->response->redirect($server . URL_CHECKOUT);
                 }
             }
         } else {
             if (isset($this->session->data['checkout_cadastre'])) {
                 unset($this->session->data['checkout_cadastre']);
                 $this->response->redirect($server . URL_REGISTER);
             }
         }
         if (isset($this->request->post['redirect']) && (strpos($this->request->post['redirect'], $this->config->get('config_url')) !== false || strpos($this->request->post['redirect'], $this->config->get('config_ssl')) !== false)) {
             $this->response->redirect(str_replace('&', '&', $this->request->post['redirect']));
         } else {
             $this->response->redirect($server . URL_ACCOUNT);
         }
         exit('Erro no redirecionamento');
     } else {
     }
     $data['breadcrumbs'] = array();
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'));
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_account'), 'href' => $server . URL_ACCOUNT);
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_login'), 'href' => $server . URL_LOGIN);
     $data['heading_title'] = $this->language->get('heading_title');
     $data['text_new_customer'] = $this->language->get('text_new_customer');
     $data['text_register'] = $this->language->get('text_register');
     $data['text_register_account'] = $this->language->get('text_register_account');
     $data['text_returning_customer'] = $this->language->get('text_returning_customer');
     $data['text_i_am_returning_customer'] = $this->language->get('text_i_am_returning_customer');
     $data['text_forgotten'] = $this->language->get('text_forgotten');
     $data['text_identify'] = $this->language->get('text_identify');
     $data['text_welcome'] = sprintf($this->language->get('text_welcome'), $this->config->get('config_name'), $server . URL_CONTACT);
     $data['client_id_googleplus'] = $this->config->get('config_client_id_googleplus');
     $data['secret_key_googleplus'] = $this->config->get('config_secret_key_googleplus');
     $data['api_key_googleplus'] = $this->config->get('config_api_key_googleplus');
     $data['entry_email'] = $this->language->get('entry_email');
     if ($this->config->get('config_type_login') == 0) {
         $data['entry_password'] = $this->language->get('entry_password');
     } else {
         if ($this->config->get('config_type_login') == 1) {
             $data['entry_password'] = $this->language->get('entry_cpf_cnpj');
         } else {
             if ($this->config->get('config_type_login') == 2) {
                 $data['entry_password'] = $this->language->get('entry_password_cpf_cnpj');
             }
         }
     }
     $data['placeholder_email'] = 'Digite seu e-mail';
     if ($this->config->get('config_type_login') == 0) {
         $data['placeholder_password'] = '******';
     } else {
         if ($this->config->get('config_type_login') == 1) {
             $data['placeholder_password'] = '******';
         } else {
             if ($this->config->get('config_type_login') == 2) {
                 $data['placeholder_password'] = '******';
             }
         }
     }
     $data['button_continue'] = $this->language->get('button_continue');
     $data['button_login'] = $this->language->get('button_login');
     if (isset($this->error['warning'])) {
         $data['error_warning'] = $this->error['warning'];
     } else {
         $data['error_warning'] = '';
     }
     $data['type_login'] = $this->config->get('config_type_login');
     $data['action'] = $server . URL_LOGIN;
     $data['register'] = $server . URL_REGISTER;
     $data['forgotten'] = $server . URL_FORGOTTEN;
     $data['contact'] = $server . URL_CONTACT;
     // google plus
     $gClient = new Google_Client();
     $gClient->setApplicationName('Login Google Plus');
     $gClient->setClientId($data['client_id_googleplus']);
     $gClient->setClientSecret($data['secret_key_googleplus']);
     $gClient->setRedirectUri($this->url->link('account/login', '', 'SSL'));
     $gClient->setDeveloperKey($data['api_key_googleplus']);
     $google_oauthV2 = new Google_Oauth2Service($gClient);
     if (isset($_REQUEST['reset'])) {
         unset($this->session->data['token_google']);
         $gClient->revokeToken();
         header('Location: ' . filter_var($google_redirect_url, FILTER_SANITIZE_URL));
         //redirect user back to page
     }
     if (isset($this->request->get['code'])) {
         $gClient->authenticate($this->request->get['code']);
         $this->session->data['token_google'] = $gClient->getAccessToken();
         $user = $google_oauthV2->userinfo->get();
         $data['token_google'] = $this->session->data['token_google'] = $gClient->getAccessToken();
         if (isset($user['id'])) {
             $data['userg_id'] = $this->session->data['userg_id'] = $user['id'];
         } else {
             $data['userg_id'] = '';
         }
         if (isset($user['email'])) {
             $data['userg_email'] = $this->session->data['userg_email'] = filter_var($user['email'], FILTER_SANITIZE_EMAIL);
         } else {
             $data['userg_email'] = '';
         }
         if (isset($user['given_name'])) {
             $data['userg_given_name'] = $this->session->data['userg_given_name'] = filter_var($user['given_name'], FILTER_SANITIZE_SPECIAL_CHARS);
         } else {
             $data['userg_given_name'] = '';
         }
         if (isset($user['family_name'])) {
             $data['userg_family_name'] = $this->session->data['userg_family_name'] = filter_var($user['family_name'], FILTER_SANITIZE_SPECIAL_CHARS);
         } else {
             $data['userg_family_name'] = '';
         }
         if (isset($user['picture'])) {
             $data['userg_picture'] = $this->session->data['userg_picture'] = filter_var($user['picture'] . '?sz=60', FILTER_VALIDATE_URL);
         } else {
             $data['userg_picture'] = '';
         }
         if (isset($user['gender'])) {
             $data['userg_gender'] = $this->session->data['userg_gender'] = filter_var($user['gender'], FILTER_VALIDATE_URL);
         } else {
             $data['userg_gender'] = '';
         }
         $customer_exist = $this->model_account_customer->getCustomerByEmail($user['email']);
         if ($customer_exist) {
             $this->customer->login($user['email'], '', true);
             $activity_data = array('customer_id' => $this->customer->getId(), 'name' => $this->customer->getFirstName() . ' ' . $this->customer->getLastName());
             $this->model_account_activity->addActivity('login', $activity_data);
             if ($this->cart->hasProducts()) {
                 $minimum_purchase = $this->cart->hasMinimumPurchase();
                 if ($minimum_purchase && (isset($minimum_purchase['requirements']) && !$minimum_purchase['requirements'])) {
                     $this->response->redirect($server . URL_CART);
                 } else {
                     $this->response->redirect($server . URL_CHECKOUT);
                 }
             } else {
                 if (isset($_COOKIE['redirect']) && $_COOKIE['redirect']) {
                     $redirect = $_COOKIE['redirect'];
                     setcookie('redirect', '');
                     unset($_COOKIE['redirect']);
                     $this->response->redirect(str_replace('&', '&', $redirect));
                 } else {
                     $this->response->redirect($server . URL_ACCOUNT);
                 }
             }
         } else {
             $this->response->redirect($server . URL_REGISTER);
         }
     } else {
         $authUrl = $gClient->createAuthUrl();
         $data['google_plus_login'] = $authUrl;
     }
     // google plus
     unset($this->session->data['token_facebook']);
     unset($this->session->data['token_google']);
     $gClient->revokeToken();
     $data['appIdFacebook'] = $this->config->get('config_app_id_facebook');
     $data['status_login_facebook'] = $this->config->get('config_status_login_facebook');
     $data['status_login_googleplus'] = $this->config->get('config_status_login_googleplus');
     if (isset($this->request->post['redirect']) && (strpos($this->request->post['redirect'], $this->config->get('config_url')) !== false || strpos($this->request->post['redirect'], $this->config->get('config_ssl')) !== false)) {
         $data['redirect'] = $this->request->post['redirect'];
     } elseif (isset($this->session->data['redirect'])) {
         $data['redirect'] = $this->session->data['redirect'];
         setcookie('redirect', $this->session->data['redirect'], time() + 60);
         unset($this->session->data['redirect']);
     } else {
         $data['redirect'] = '';
     }
     if (isset($this->session->data['success'])) {
         $data['success'] = $this->session->data['success'];
         unset($this->session->data['success']);
     } else {
         $data['success'] = '';
     }
     if (isset($this->request->post['email'])) {
         $data['email'] = $this->request->post['email'];
     } else {
         $data['email'] = '';
     }
     if (isset($this->request->post['password'])) {
         $data['password'] = $this->request->post['password'];
     } else {
         $data['password'] = '';
     }
     $data['column_left'] = $this->load->controller('common/column_left');
     $data['column_right'] = $this->load->controller('common/column_right');
     $data['content_top'] = $this->load->controller('common/content_top');
     $data['content_bottom'] = $this->load->controller('common/content_bottom');
     $data['footer'] = $this->load->controller('common/footer');
     $data['header'] = $this->load->controller('common/header');
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/login.tpl')) {
         $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/account/login.tpl', $data));
     } else {
         $this->response->setOutput($this->load->view('default/template/account/login.tpl', $data));
     }
 }
Example #16
0
 public function uninstall()
 {
     $this->loadLanguage('extension/ka_extensions');
     if (!$this->user->hasPermission('modify', 'extension/ka_extensions') && !$this->user->hasPermission('modify', 'user/user_permission')) {
         $this->addTopMessage($this->language->get('error_permission'), 'E');
         $this->redirect($this->url->link('extension/ka_extensions', 'token=' . $this->session->data['token'], 'SSL'));
     } else {
         $this->load->model('extension/extension');
         $this->load->model('setting/setting');
         $this->model_extension_extension->uninstall('ka_extensions', $this->request->get['extension']);
         $this->model_setting_setting->deleteSetting($this->request->get['extension']);
         require_once modification(DIR_APPLICATION . 'controller/ka_extensions/' . $this->request->get['extension'] . '.php');
         $class = 'ControllerKaExtensions' . str_replace('_', '', $this->request->get['extension']);
         $class = new $class($this->registry);
         if (method_exists($class, 'uninstall')) {
             $class->uninstall();
         }
         $this->redirect($this->url->link('extension/ka_extensions', 'token=' . $this->session->data['token'], 'SSL'));
     }
 }
		[required] => 
		[sort_order] => 1 
	)
)
*/
//session_unset();
/**
 * Class of Ajax Quick Checkout module. This is the main file for calculating and validating all the fields.
 * 
 * @author dreamvention
 * @link http://www.opencart.com/index.php?route=extension/extension/info&extension_id=9132
 * @package quickcheckout
 */
use Monolog\Logger;
use Monolog\Handler\BrowserConsoleHandler;
require_once modification(DIR_SYSTEM . 'library/ubench.php');
class ControllerModuleDQuickcheckout extends Controller
{
    private $settings = array();
    private $texts = array('title', 'tooltip', 'description', 'text');
    private $debug_on = true;
    private $debug_path = 'system/logs/error.txt';
    private $time = '';
    private $data = array();
    private $template = '';
    private $log = '';
    private $bench = '';
    /**
     * Index method: loads the quickcheckout module.
     * 
     * This is the main method to show all view blocks of the get_view methods
Example #18
0
/*      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                */
/*      GNU General Public License for more details.                                 */
/*                                                                                   */
/*      You should have received a copy of the GNU General Public License            */
/*      along with this program.  If not, see <http://www.gnu.org/licenses/>.        */
/*                                                                                   */
/*************************************************************************************/
require_once "pre.php";
require_once "auth.php";
if (!est_autorise("acces_configuration")) {
    exit;
}
if (isset($action)) {
    switch ($action) {
        case "modifier":
            modification($serveur, $port, $username, $password, $secure, $active);
            break;
    }
}
function modification($serveur, $port, $username, $password, $secure, $active)
{
    $smtp = new Smtpconfig();
    $smtp->charger(1);
    $smtp->serveur = $serveur;
    $smtp->port = $port;
    $smtp->username = $username;
    $smtp->password = $password;
    $smtp->secure = $secure;
    if ($active == "on") {
        $smtp->active = 1;
    } else {
Example #19
0
function vendor($class)
{
    $file = DIR_SYSTEM . 'vendor/' . str_replace('\\', '/', strtolower($class)) . '.php';
    if (is_file($file)) {
        include_once VQMod::modCheck(modification($file));
        return true;
    } else {
        return false;
    }
}
Example #20
0
<?php

/*
	Project: Ka Extensions
	Author : karapuz <*****@*****.**>

	Version: 3 ($Revision: 27 $)
*/
require_once modification(DIR_APPLICATION . 'controller/extension/modification.php');
class KaModificationController extends ControllerExtensionModification
{
    protected function getList()
    {
        return true;
    }
    public function refresh()
    {
        $GLOBALS['ka_silent_return'] = true;
        $result = parent::refresh();
        $GLOBALS['ka_silent_return'] = false;
        return $result;
    }
}
class KaInstaller extends KaController
{
    // contstants
    //
    protected $extension_version = '0.0.0';
    protected $min_store_version = '2.0.0.0';
    protected $max_store_version = '2.0.0.9';
    protected $tables;