/** * Handles the post from the registration form. * */ function register() { if (belongsToGroup()) { redirect('sms'); } //displays the view $data['register'] = false; $data['fal'] = $this->fal_front->register(); $this->load->view($this->_container, $data); //$this->output->enable_profiler(TRUE); }
function index() { $data['heading'] = 'SendSMS2India'; if (belongsToGroup() || isFbLoggedIn()) { $data['sms'] = anchor('sms', 'SMS', array('data-icon' => 'custom')); $data['contacts'] = anchor('contacts', 'Contacts', array('data-icon' => 'custom')); $data['page'] = $this->config->item('FAL_template_dir') . 'template/main'; $data['header'] = true; $data['navigation'] = false; } else { $data['page'] = $this->config->item('FAL_template_dir') . 'template/home'; $data['header'] = false; $data['navigation'] = true; } $this->load->vars($data); $this->load->view($this->_container); //$this->output->enable_profiler(TRUE); }
require_once '../../../../includes/STN.class.php'; require_once '../../com_virtuemart/ajax/acl.php'; require_once "../../com_importer/ajax/lib.php"; ajaxACL(__FILE__, array('administrator', 'super administrator')); $pdo = STN::getPDO(); $results = $pdo->query("\n\tSELECT *\n\t\tFROM `stn_matchup_results`\n\t\tWHERE `import_status` = 'Y' AND `dup_field` != 'no'\n\t;\n"); $rowCount = $results->rowCount(); include_once "{$mosConfig_absolute_path}/administrator/components/com_virtuemart/virtuemart.cfg.php"; $error = array(); $errorSkus = array(); $alreadyImported = array(); $markImported = $pdo->prepare("\n\tUPDATE `stn_matchup_results`\n\t\tSET `import_status`='AI'\n\t\tWHERE `ID`=:id\n\t;\n"); STN::depend('ProductDataProvider'); $processedSkus = array(); try { belongsToGroup($_SESSION, 'super administrator'); $provider = getProvider('STN'); $categories = $provider->getCategories(); $unImportable = array(); $importedCount = 0; foreach ($results->fetchAll(PDO::FETCH_ASSOC) as $importable) { $sku = $importable['stn_sku_match']; if (empty($sku)) { $error[] = 'No import candidate for item number: ' . $importable['POSItemNumber'] . ' missing SKU.'; continue; } if (productExistsLocally($sku, STN::getPDO())) { $alreadyImported[] = $sku; $importCount += 1; continue; }
/** * Returns the login anchor (message) namely * IF A USER IS LOGGED IN: * "Welcome the_user_name / logout" * * IF A USER IS NOT LOGGED IN: * "Welcome guest / login" * * you can customise the appearance of these messages modifying the views used * to display the loginAnchor(): the files are in * $obj->config->item('FAL_template_dir').content/login_anchor_guest * and * $obj->config->item('FAL_template_dir').content/login_anchor_user * * If you use a controller not named "auth" to handle login and logout actions * you must specify the controller/method that handles them when calling this function * ------------------------------------------------------ * usage examples in a view: * ------------------------------------------------------ * <?=loginAnchor('auth/login', 'auth/logout');?> * * @param string $login_uri the controller/method that handles the login action * @param string $logout_uri the controller/method that handles the logout action * @param unknown_type $logout_attributes * @param unknown_type $login_attributes * @return the message in a view */ function loginAnchor($login_uri = null, $logout_uri = null, $logout_attributes = null, $login_attributes = null) { $obj =& get_instance(); $obj->lang->load('freakauth'); $data['welcome'] = $obj->lang->line('FAL_welcome'); $tpl_dir = $obj->config->item('FAL_template_dir'); if (belongsToGroup()) { // if we have a user $data['logout_label'] = $obj->lang->line('FAL_logout_label'); $data['logout_attributes'] = $logout_attributes; $data['logout_uri'] = $logout_uri != null ? $logout_uri : $obj->config->item('FAL_logout_uri'); return $obj->load->view($tpl_dir . 'content/login_anchor_user', $data, true); } else { // if we have a guest $data['login_label'] = $obj->lang->line('FAL_login_label'); $data['login_attributes'] = $login_attributes; $data['login_uri'] = $login_uri != null ? $login_uri : $obj->config->item('FAL_login_uri'); return $obj->load->view($tpl_dir . 'content/login_anchor_guest', $data, true); } }
/** * Returns the login anchor (message) namely * IF A USER IS LOGGED IN: * "Welcome the_user_name / logout" * * IF A USER IS NOT LOGGED IN: * "Welcome guest / login" * * you can customise the appearance of these messages modifying the views used * to display the loginAnchor(): the files are in * $obj->config->item('FAL_template_dir').content/login_anchor_guest * and * $obj->config->item('FAL_template_dir').content/login_anchor_user * * If you use a controller not named "auth" to handle login and logout actions * you must specify the controller/method that handles them when calling this function * ------------------------------------------------------ * usage examples in a view: * ------------------------------------------------------ * <?=loginAnchor('auth/login', 'auth/logout');?> * * @param string $login_uri the controller/method that handles the login action * @param string $logout_uri the controller/method that handles the logout action * @param unknown_type $logout_attributes * @param unknown_type $login_attributes * @return the message in a view */ function loginAnchor($login_uri = null, $logout_uri = null, $logout_attributes = null, $login_attributes = null, $register = false) { $logout_attributes = $login_attributes = array('data-role' => 'button', 'data-theme' => 'c'); $obj =& get_instance(); $obj->lang->load('freakauth'); $data['welcome'] = $obj->lang->line('FAL_welcome'); $tpl_dir = $obj->config->item('FAL_template_dir'); $home_url = base_url(); $home_url_attr = array('data-role' => 'button', 'data-icon' => 'home', 'data-theme' => 'c'); $fb_url_attr = array('data-role' => 'button', 'data-theme' => 'c', 'data-icon' => 'fb-connect'); $fb_login_url = ''; $fb_logout_url = ''; /*$data['fb_url_attr'] = $fb_url_attr; $data['fb_login_url'] = getFbLogin_Url(); $data['fb_connect_label'] = $obj->lang->line('SMS_connect_label'); $data['fb_logout_url'] = $fb_logout_url;*/ $data['fb_url_attr'] = ''; $data['fb_login_url'] = ''; $data['fb_connect_label'] = $obj->lang->line('SMS_connect_label'); $data['fb_logout_url'] = ''; $data['home_url'] = $home_url; $data['home_url_attr'] = $home_url_attr; $data['home_label'] = $obj->lang->line('SMS_home_label'); // $isFbLogin = getFbSessions(); $isFbLogin = false; if (belongsToGroup() || $isFbLogin) { // if we have a user if (!$isFbLogin) { $data['logout_uri'] = $logout_uri != null ? $logout_uri : $obj->config->item('FAL_logout_uri'); } else { $logout_attributes['data-icon'] = 'fb-connect'; $data['logout_uri'] = $obj->config->item('SMS_fb_logout_uri'); //getFbLogout_Url(); } $data['logout_label'] = $obj->lang->line('FAL_logout_label'); $data['logout_attributes'] = $logout_attributes; return $obj->load->view($tpl_dir . 'content/login_anchor_user', $data, true); } else { // if we have a guest if (!$register) { $data['login_label'] = $obj->lang->line('FAL_login_label'); $data['login_attributes'] = $login_attributes; $data['login_uri'] = $login_uri != null ? $login_uri : $obj->config->item('FAL_login_uri'); } else { $data['login_label'] = $obj->lang->line('FAL_register_label'); $data['login_attributes'] = $login_attributes; $data['login_uri'] = $login_uri != null ? $login_uri : $obj->config->item('FAL_register_uri'); } return $obj->load->view($tpl_dir . 'content/login_anchor_guest', $data, true); } }