/** * Retourne les données du chart * */ public function processGetChartsDatas() { $cle = CopixRequest::get('cle'); echo CopixSession::get("charts|datas|{$cle}"); CopixSession::set("charts|datas|{$cle}", null); return _arNone(); }
public function processGetTable() { $ppo = new CopixPPO(); // Si c'est pour de l'ajax if (CopixRequest::get('url') == null) { try { //Recup les données $id = CopixRequest::get('table_id'); $table = CopixListFactory::get($id); if (CopixRequest::get('submit') !== 'false') { $table->getFromRequest(); } //On génère le HTML $ppo->MAIN = $table->generateTable(); } catch (Exception $e) { //En cas d'erreur en etant en ajax, on renvoi l'erreur $ppo->MAIN = $e->getMessage(); return _arDirectPPO($ppo, 'blank.tpl'); } return _arDirectPPO($ppo, 'blank.tpl'); //Si c'est pas en ajax } else { //On récup les données $id = CopixRequest::get('table_id'); $table = CopixListFactory::get($id); if (CopixRequest::get('submit') !== 'false') { $table->getFromRequest(); } //Et on redirige return _arRedirect(_url(CopixRequest::get('url'))); } }
/** * @param string $pContent le contenu à afficher */ public function beforeDisplay(&$pContent) { $elapsedTime = $this->_timer->stop(); switch ($this->config->trigger) { case 'url': if (CopixRequest::get('SpeedView') == 'show') { $this->_speedprocess = true; } break; case 'display': $this->_speedprocess = true; break; } if ($this->_speedprocess) { switch ($this->config->target) { case 'comment': $pContent = str_replace('<head>', '<head><!-- ' . $elapsedTime . ' --> ', $pContent); break; case 'display': $pContent = str_replace('</body>', $elapsedTime . '</body>', $pContent); break; case 'log': _log($elapsedTime, 'speedview', CopixLog::INFORMATION); } } }
/** * Editer un commentaire */ public function processEditComment() { CopixRequest::assert('id'); if (CopixRequest::getInt('confirm') == 1) { $arrComments = _ioDAO('comments')->findBy(_daoSP()->addCondition("comment_id", "=", _request('id'))); $objComment = $arrComments[0]; $objComment->comment_id = _request('id'); $objComment->content_comment = _request('content'); $objComment->format_comment = 'TEXT'; //aujourd'hui on ne supporte que le format text pour les commentaires $objComment->authorlogin_comment = _request('author'); $objComment->authoremail_comment = _request('mail'); $objComment->authorsite_comment = _request('site'); $objComment->date_comment = date('YmdHis'); $objComment->noCaptcha = 1; _ioDAO('comments')->update($objComment); return _arRedirect(CopixRequest::get('url_return', _url('comments|admin|'))); } else { $ppo = new CopixPPO(); $ppo->TITLE_PAGE = _i18n('comments.admin.editcomment'); $ppo->arrComments = _ioDAO('comments')->findBy(_daoSP()->addCondition("comment_id", "=", _request('id'))); $ppo->url_return = _request('url_return', null); return _arPPO($ppo, 'editcomment.admin.tpl'); } }
public function processSelectPage() { $tpl = new CopixTpl(); $tpl->assign('TITLE_PAGE', CopixI18N::get('htmleditor.title.pageSelect')); $tpl->assignZone('MAIN', 'htmleditor|SelectPage', array('onlyLastVersion' => 1, 'editorName' => CopixRequest::get('editorName', null, true), 'popup' => CopixRequest::get('popup', null, true))); return new CopixActionReturn(CopixActionReturn::DISPLAY_IN, $tpl, '|blank.tpl'); }
function moduleContext($step = 'open', $title_page = '', $titleContext = '') { $module = CopixRequest::get('module'); $content = CopixZone::process('kernel|moduleContext', array('STEP' => $step, 'MODULE' => $module, 'TITLE_PAGE' => $title_page, 'TITLE_CONTEXT' => $titleContext)); if (!$content) { trigger_error('Unable to process Module Context Frame', E_USER_WARNING); } else { echo $content; } }
/** * Formulaire de modification ou de création d'un élément en base de données * On édite soit a partir de données passées en paramètre */ public function getEdit() { $ppo = new CopixPPO(); $ppo->TITLE_PAGE = "Modification d'un élément"; if (!($ppo->toEdit = _ioDAO('copixtestautodao')->get(CopixRequest::get('id_test', null, true)))) { throw new Exception("Impossible de retrouver l'élément demandé"); } $ppo->errors = CopixRequest::get('errors', array(), true); return _arPpo($ppo, 'autodao.form.tpl'); }
/** * Fonction qui est appellée pour afficher l'aide */ public function processDefault() { if (_request('id_sh', null) === null) { return CopixActionGroup::process('generictools|Messages::getError', array('message' => _i18n('simplehelp.error.missingParameters'), 'back' => _url('simplehelp|admin|listAide'))); } $aide = _ioDAO('simplehelp')->get(_request('id_sh', null)); $ppo = new CopixPPO(array('TITLE_PAGE' => $aide->title_sh)); $ppo->MAIN = CopixZone::process('ShowAide', array('id_sh' => CopixRequest::get('id_sh', null))); return _arDirectPPO($ppo, 'popup.tpl'); }
public function _createContent(&$toReturn) { $tpl = new CopixTpl(); $kernel = _class("kernel"); $toReturn = ""; $arModulesPath = CopixConfig::instance()->arModulesPath; $display = false; foreach ($arModulesPath as $modulePath) { if (file_exists(COPIX_PROJECT_PATH . "themes/" . $kernel->getTheme() . "/kernel/footer.tpl")) { $tpl_file = COPIX_PROJECT_PATH . "themes/" . $kernel->getTheme() . "/kernel/footer.tpl"; } else { $tpl_file = $modulePath . 'kernel/templates/footer.tpl'; } if (!file_exists($tpl_file)) { continue; } $display = true; // Récupération des infos de géolocalisation. $whereami = Kernel::whereAmI(); if (isset($whereami['BU_GRVILLE'])) { $tpl->assign('grville_id', $whereami['BU_GRVILLE']['id']); $tpl->assign('grville_nom', $whereami['BU_GRVILLE']['nom']); } if (isset($whereami['BU_VILLE'])) { $tpl->assign('ville_id', $whereami['BU_VILLE']['id']); $tpl->assign('ville_nom', $whereami['BU_VILLE']['nom']); } if (isset($whereami['BU_ECOLE'])) { $tpl->assign('ecole_id', $whereami['BU_ECOLE']['id']); $tpl->assign('ecole_nom', $whereami['BU_ECOLE']['nom']); } if (isset($whereami['BU_CLASSE'])) { $tpl->assign('classe_id', $whereami['BU_CLASSE']['id']); $tpl->assign('classe_nom', $whereami['BU_CLASSE']['nom']); } // Récupération des valeurs d'URL. if ($module = CopixRequest::get('module')) { $tpl->assign('module', $module); } if ($action = CopixRequest::get('action')) { $tpl->assign('action', $action); } // Récupération des valeurs de sessions (personne). if (_currentUser()->getExtra('type')) { $tpl->assign('user_type', _currentUser()->getExtra('type')); $tpl->assign('user_id', _currentUser()->getExtra('id')); } } // Si le fichier de template n'existe pas, pas d'erreur. if ($display) { $toReturn = $tpl->fetch('kernel|footer.tpl'); } return true; }
public function beforeProcess(&$pExecParams) { if ($theme = $this->config->getThemeFor(CopixRequest::get('module'))) { CopixTpl::setTheme($theme); } //Ajout d'une gestion de tpl par thème $config = CopixConfig::instance(); $theme = CopixTpl::getThemeInformations(CopixTpl::getTheme()); if ($theme->tpl != null) { $config->mainTemplate = $theme->tpl; } }
/** * Supression d'un plugin de la liste des plugins enregistrés */ public function processRemovePlugin() { //on regarde si le plugin fait parti des plugins déja enregistrés $arPluginsConfiguration = array(); if (in_array($pluginName = CopixRequest::get('plugin'), $arPlugins = CopixConfig::instance()->plugin_getRegistered())) { foreach ($arPlugins as $plugin) { if ($plugin != $pluginName) { $arPluginsConfiguration[] = $plugin; } } _class('PluginsConfigurationFile')->write($arPluginsConfiguration); } return _arRedirect(_url('plugin|')); }
/** * Permet d'exporter les classes des modukes * * @return CopixActionReturn */ public function processExportClass() { $pModuleName = CopixRequest::get('moduleName'); $pClassFileName = CopixRequest::get('classFileName'); // si on a confirmé l'ajout if (CopixRequest::get('confirm')) { $pServiceName = trim(CopixRequest::get('serviceName')); $pClassName = CopixRequest::get('className'); $pClassFileName = _request('classFileName'); $pModuleName = _request('moduleName'); // nom de service vide if ($pServiceName == '') { return _arRedirect(_url('admin|ExportClass', array('error' => 'serviceEmpty', 'moduleName' => $pModuleName, 'classFileName' => $pClassFileName))); } // verification si on n'a pas déja un service de ce nom $wsservices = _ioDao('wsservices')->findBy(_daoSP()->addCondition('name_wsservices', '=', $pServiceName)); if (count($wsservices) > 0) { return _arRedirect(_url('admin|ExportClass', array('error' => 'serviceExists', 'moduleName' => $pModuleName, 'classFileName' => $pClassFileName))); } CopixDB::getConnection()->doQuery("insert into wsservices (name_wsservices, module_wsservices, file_wsservices, class_wsservices) values ('" . $pServiceName . "','" . $pModuleName . "','" . $pClassFileName . "', '" . $pClassName . "')"); $res = 'Url du Webservice : <a href="' . _url('wsserver||', array('wsname' => $pServiceName)) . '">' . _url('wsserver||', array('wsname' => $pServiceName)) . '</a><br/>' . "\n"; $res .= 'Url du fichier wsdl : <a href="' . _url('wsserver|default|wsdl', array('wsname' => $pServiceName)) . '">' . _url('wsserver|default|wsdl', array('wsname' => $pServiceName)) . '</a><br/>' . "\n"; $res .= '<br />'; $res .= '<input type="button" value="' . _i18n('wsserver.back') . '" onclick="javascript: document.location=\'' . _url('admin|manageWebServices') . '\';" />'; $tpl = new CopixTpl(); $tpl->assign('MAIN', $res); return new CopixActionReturn(CopixActionReturn::DISPLAY, $tpl); // si on doit afficher le formulaire d'ajout } else { $ppo = new CopixPPO(); $ppo->TITLE_PAGE = _i18n('wsserver.title.manageWebServices'); $ppo->classFileName = $pClassFileName; $ppo->arErrors = array(); // erreur "service existant" passée en paramètre if (_request('error') !== null) { $ppo->arErrors[] = _i18n('wsserver.error.' . _request('error')); } $ppo->ModuleName = $pModuleName; $arBefore = get_declared_classes(); include CopixModule::getPath($pModuleName) . COPIX_CLASSES_DIR . $pClassFileName; $arAfter = get_declared_classes(); $arClass = array_diff($arAfter, $arBefore); sort($arClass); if (count($arClass) == 0) { throw new Exception('Pas de classe à exporter'); } $ppo->arClass = $arClass; return _arPPO($ppo, 'wsservices.add.php'); } }
public function request($iName, $iType = 'other', $default = null) { $oReturn = CopixRequest::get($iName, $default); switch ($iType) { case 'str': return (string) $oReturn; break; case 'int': return $oReturn * 1; break; case 'other': return $oReturn; break; } }
/** * Supression d'une variable de session. */ public function processRemove() { $namespace = CopixRequest::get('for_namespace'); $key = CopixRequest::get('key'); if ($namespace !== null) { if ($key !== null) { unset($_SESSION['COPIX'][$namespace][$key]); } else { unset($_SESSION['COPIX'][$namespace]); } } else { if (isset($_SESSION[$key])) { unset($_SESSION[$key]); } } return _arRedirect(_url(CopixRequest::get('popup') ? 'admin|session|popup' : 'admin|session|')); }
/** * Retourne la page "autofermée" qui va rajouter le mail crypté demandé dans l'éditeur HTML */ public function processdoCryptMailto() { $tpl = new CopixTpl(); $tplInterieur = new CopixTpl(); $address = CopixRequest::get('mailAdress'); $encodedAddress = ''; for ($i = 0; $i < strlen($address); $i++) { if (preg_match('!\\w!', $address[$i])) { $encodedAddress .= '%' . bin2hex($address[$i]); } else { $encodedAddress .= $address[$i]; } } $tplInterieur->assign('mailto', $encodedAddress); $tpl->assign('TITLE_PAGE', CopixI18N::get('htmleditor.titlePage.mailcrypt')); $tpl->assign('MAIN', $tplInterieur->fetch('cryptmailto.tpl')); return new CopixActionReturn(CopixActionReturn::DISPLAY_IN, $tpl, '|blank.tpl'); }
/** * Vérifie que l'on est bien authentifié (A voir). */ public function beforeAction() { $pServiceName = CopixRequest::get('wsname'); $this->_path = CopixModule::getPath('wsserver'); if (isset($pServiceName)) { $this->_wsname = $pServiceName; $arRes = _ioDAO('wsservices')->findBy(_daoSP()->addCondition('name_wsservices', '=', $pServiceName)); if (count($arRes) == 0) { throw new CopixException('Service introuvable ' . htmlentities($pServiceName)); } $wsServiceInfo = $arRes[0]; $this->_exportModule = $wsServiceInfo->module_wsservices; $this->_exportClass = $wsServiceInfo->class_wsservices; $this->_exportClassFilename = CopixModule::getPath($this->_exportModule) . COPIX_CLASSES_DIR . strtolower($wsServiceInfo->file_wsservices); } else { $this->_exportModule = CopixConfig::get('wsserver|exportedModule'); $this->_exportClass = CopixConfig::get('wsserver|exportedClass'); $this->_exportClassFilename = CopixModule::getPath($this->_exportModule) . COPIX_CLASSES_DIR . strtolower(CopixConfig::get('wsserver|exportedClassFile')); } }
public function set($data = null) { $dao = _dao("logs|logs"); $nouveau = _record("logs|logs"); $types = array('ERROR', 'DEBUG', 'INFO', 'ALERT', 'LOG', 'AUTO', 'GO'); if (isset($data['type']) && in_array($data['type'], $types)) { $nouveau->logs_type = $data['type']; } else { $nouveau->logs_type = 'UNKNOWN'; } if (isset($data['message'])) { $nouveau->logs_message = $data['message']; } $module = CopixRequest::get('module', 'kernel'); $action = CopixRequest::get('action', 'default'); $nouveau->logs_mod_name = $module; $nouveau->logs_mod_action = $action; $user = Kernel::getSessionBU(); if (sizeof($user) && isset($user['id'])) { $nouveau->logs_user_id = $user['id']; $nouveau->logs_user_login = $user['login']; } // Node $nouveau->logs_date = date("Y-m-j H:i:s", time()); $nouveau->logs_user_ip = $_SERVER['REMOTE_ADDR']; $nouveau->logs_url = $_SERVER['QUERY_STRING']; // Kernel::MyDebug( $nouveau ); if (isset($data['node_type'])) { $nouveau->logs_node_type = $data['node_type']; } if (isset($data['node_id'])) { $nouveau->logs_node_id = $data['node_id']; } if (isset($data['module_type'])) { $nouveau->logs_module_type = $data['module_type']; } if (isset($data['module_id'])) { $nouveau->logs_module_id = $data['module_id']; } $dao->insert($nouveau); }
public function processSave() { if (!$this->flash->has('nextAnsw')) { return $this->error('quiz.errors.badOperation'); } if (is_null(qSession('id'))) { return CopixActionGroup::process('quiz|default::Quiz', array('id' => false)); } //get url's answ id $qId = $this->request('qId') * 1; //test id validity if ($qId != $this->flash->currentAnsw) { return $this->error('quiz.errors.badOperation'); } //get responses form datas $pResponse = CopixRequest::get('response', false); if (!$pResponse) { $this->flash->error = $this->i18n('quiz.errors.emptyResponse'); return $this->go('quiz|default|question', array('id' => qSession('id'), 'qId' => $this->flash->currentAnsw)); } $optType = $this->flash->typeAnsw == 'choice' ? 'radio' : 'txt'; $userId = $this->user->id; //delete previous info $criteres = _daoSp()->addCondition('id_user', '=', $userId)->addCondition('id_question', '=', $this->flash->currentAnsw, 'and'); _dao('quiz_response_insert')->deleteBy($criteres); if ($optType == 'radio') { $i = 0; foreach ($pResponse as $response) { $record = _record('quiz_response_insert'); $record->id_user = $userId; $record->id_choice = $response + 0; $record->id_question = $this->flash->currentAnsw; $record->date = time(); $responses[] = $response + 0; _dao('quiz_response_insert')->insert($record); $i++; } } else { //cas du submit txt } //lock test $quizData = _dao('quiz_quiz')->get(qSession('id')); if ($quizData->lock == 1) { return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('quiz.errors.lock'), 'back' => CopixUrl::get('quiz||'))); } $nextQ = $this->flash->nextAnsw; //if next answ = flash : end of quiz if (!$nextQ) { return _arRedirect(_url('quiz|default|endQuestions', array('id' => qSession('id')))); } return _arRedirect(_url('quiz|default|question', array('id' => qSession('id'), 'qId' => $nextQ))); }
public function getField($pName, $pParams = array(), $pAssert = true) { $id = is_string($pName) ? $pName : serialize($pName); if (!isset($this->_fields[$id])) { if (isset($pParams['kind']) && $pParams['kind'] == 'error') { return false; } $pParams['type'] = isset($pParams['type']) ? $pParams['type'] : null; $pParams['name'] = $pName; $this->_fields[$id] = CopixFieldFactory::get($pParams['type'], $pParams, $pAssert); if (!$this->_fields[$id] instanceof ICopixFieldForm) { unset($this->_fields[$id]); throw new CopixException($pType . ' n\'implémente pas ICopixFieldForm'); } $this->_fields[$id]->setMode($this->_mode); $this->_fields[$id]->fillFromRecord($this->_record); } else { foreach ($pParams as $key => $params) { if ($key != 'validator') { $this->_fields[$id]->setParam($key, $params); } } } if (CopixRequest::get('error_' . $this->_id) == null) { $this->_fields[$id]->setDefaultValue(isset($pParams['value']) ? $pParams['value'] : null); } return $this->_fields[$id]; }
/** * Telechargement d'un document joint a une fiche * * @author Christophe Beyer <*****@*****.**> * @since 2011/01/31 * @param string $fichier Nom du fichier * */ public function processDoc() { $iFichier = CopixRequest::get('fichier'); $malleService =& CopixClassesFactory::Create('malle|malleService'); preg_match('/^([0-9]+)_(.+)$/', $iFichier, $regs); $file = COPIX_VAR_PATH . CopixConfig::get('fichesecoles|docPath') . $iFichier; if (@file_exists($file)) { $filename = $regs[2]; return _arFile($file, array('filename' => $filename, 'content-type' => $malleService->getMimeType($file), 'content-disposition' => 'attachement')); } header("HTTP/1.0 404 Not Found"); return new CopixActionReturn(COPIX_AR_NONE, 0); }
/** * Effacer une aide simple * */ public function processDelete() { if (CopixRequest::get('id_sh', null) === null) { return CopixActionGroup::process('generictools|Messages::getError', array('message' => _i18n('simplehelp.error.missingParameters'), 'back' => _url('simplehelp|admin|listAide'))); } $dao = _ioDao('simplehelp'); if (!($toDelete = $dao->get(CopixRequest::get('id_sh')))) { return CopixActionGroup::process('generictools|Messages::getError', array('message' => _i18n('simplehelp.unableToFind'), 'back' => _url('simplehelp|admin|listAide'))); } //Confirmation screen ? if (CopixRequest::get('confirm', null) === null) { return CopixActionGroup::process('generictools|Messages::getConfirm', array('title' => _i18n('simplehelp.title.confirmdelevent'), 'message' => _i18n('simplehelp.message.confirmdelevent'), 'confirm' => _url('simplehelp|admin|delete', array('id_sh' => $toDelete->id_sh, 'confirm' => '1')), 'cancel' => _url('simplehelp|admin|listAide'))); } //Delete aide $dao->delete($toDelete->id_sh); return _arRedirect(_url('simplehelp|admin|listAide')); }
/** * Sélection d'un module et redirection vers la page par défaut * (simplement pour éviter les problèmes de rafraichissement de page) */ public function processSelectModule() { return _arRedirect(_url('admin|parameters|', CopixRequest::get('choiceModule') !== null ? array('choiceModule' => CopixRequest::get('choiceModule')) : array())); }
/** * Supression d'un utilisateur du groupe */ public function processRemoveUser() { $this->_validFromRequest(); $users = CopixSession::get('auth|usersgroup'); unset($users[CopixRequest::get('handlerUser')][CopixRequest::get('idUser')]); CopixSession::set('auth|usersgroup', $users); return _arRedirect(_url('auth|groups|edit')); }
/** * Validation des modifications apportées sur un utilisateur */ public function processValid() { //$user = new stdClass (); $user = _record('dbuser'); $user->login_dbuser = _request('login_dbuser', ''); $user->email_dbuser = _request('email_dbuser'); $errors = array(); //on vérifie si le login n'est pas déja pris $sp = _daoSp(); $sp->addCondition('login_dbuser', '=', $user->login_dbuser); if ($user->login_dbuser === '') { $errors['loginEmpty'] = 1; } if (count(_ioDAO('dbuser')->findBy($sp))) { $errors['loginNotAvailable'] = 1; } //on vérifie si un mot de passe est donné qu'ils soient bien identiques if (CopixRequest::get('password_dbuser')) { if (CopixRequest::get('password_dbuser') != CopixRequest::get('password_confirmation_dbuser')) { $errors['passwordDoNotMatch'] = 1; } else { $user->password_dbuser = md5(CopixRequest::get('password_dbuser')); } } else { //Comme c'est automatiquement un nouvel utilisateur, il est obligatoire de saisir un nouveau mot de passe. $errors['passwordEmpty'] = 1; } if (Copixconfig::get('auth|typeConfirm') == "email") { if (!$user->email_dbuser) { $errors['emailEmpty'] = 1; } else { try { CopixFormatter::getMail($user->email_dbuser); } catch (CopixException $e) { $errors['emailIsBad'] = 1; } } } if (Copixconfig::get('auth|typeConfirm') == "email") { $user->enabled_dbuser = 0; } else { $user->enabled_dbuser = 1; } //Si le module imageprotect est activé test la protection anti-spam if (CopixModule::isEnabled('antispam')) { CopixRequest::assert('confirmcode_dbuser'); CopixRequest::assert('idcode_dbuser'); $code = _request('confirmcode_dbuser'); $idCode = _request('idcode_dbuser'); // Test si le code de ssession est valide _classInclude('antispam|imageprotect'); if (!ImageProtect::getCode($idCode, $code)) { $errors['confirmCodeBad'] = 1; } } //redirige vers l'éditeur si il y a des erreurs if (count($errors) != 0) { $errors['idForm'] = uniqid(); CopixSession::set('auth|createForm', $user, $errors['idForm']); return _arRedirect(_url('auth|usersregister|edit', $errors)); } //sauvegarde de l'utilisateur _ioDAO('dbuser')->insert($user); return _arRedirect(_url('')); }
<?php /* @file main.php @desc Main layout constructor @version 1.0.0b @date 2010-05-28 09:28:09 +0200 (Fri, 28 May 2010) @author S.HOLTZ <*****@*****.**> Copyright (c) 2010 CAP-TIC <http://www.cap-tic.fr> */ include_once COPIX_PROJECT_PATH . "themes/default/helper.php"; $module = CopixRequest::get('module'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head profile="http://www.w3.org/2005/10/profile"> <meta content="text/html; charset=UTF-8" http-equiv="content-type" /> <title><?php echo isset($TITLE_BAR) ? $TITLE_BAR : ''; ?> </title> <link rel="icon" type="image/x-icon" href="<?php echo CopixUrl::getRequestedScriptPath(); ?> favicon.ico" /> <?php include_once COPIX_PROJECT_PATH . "themes/default/styles.php"; ?>
/** * Détecte si l'utilisateur a défini une lang et un country */ private function _detectUserSelection() { $lang = null; $country = null; if (CopixRequest::get('lang') != null) { $lang = CopixRequest::get('lang'); } if (CopixRequest::get('country') != null) { $country = CopixRequest::get('country'); } if (($lang || $country) && $this->_accept($lang, $country)) { $this->_lang = $lang; $this->_country = $country; } }
/** * Ecran de connexion */ public function processForm() { $ppo = new CopixPPO(); $ppo->TITLE_PAGE = _i18n('auth.connect'); if (CopixAuth::getCurrentUser()->isConnected()) { $ppo->user = CopixAuth::getCurrentUser(); return _arRedirect(_url('kernel||getHome')); } $config = CopixConfig::instance(); if (count($config->copixauth_getRegisteredUserHandlers()) > 1 && CopixConfig::get('auth|multipleConnectionHandler')) { $ppo->noCredential = true; } $ppo->auth_url_return = CopixRequest::get('auth_url_return', _url('#')); $ppo->failed = array(); if (CopixRequest::getInt('noCredential', 0)) { $ppo->failed[] = _i18n('auth.error.noCredentials'); } if (CopixRequest::getInt('failed', 0)) { $ppo->failed[] = _i18n('auth.error.failedLogin'); } $ppo->createUser = Copixconfig::get('auth|createUser'); $ppo->conf_Saml_actif = CopixConfig::exists('default|conf_Saml_actif') ? CopixConfig::get('default|conf_Saml_actif') : 0; return _arPPO($ppo, 'login.form.php'); }
/** * Set the home page of the web site */ public function processsetHomePage() { if (_request('id') !== null) { CopixConfig::set('|homePage', _url('cms|default|get', array('id' => CopixRequest::get('id'), 'online' => 'true'))); } elseif (($url = CopixRequest::get('urlinput')) !== null) { CopixConfig::set('|homePage', $url); } else { return CopixActionGroup::process('generictools|Messages::getError', array('message' => _i18n('error|error.specifyid'), 'back' => _url('admin||'))); } return _arRedirect(_url('admin||')); }
/** * Verification de spam, selon les parametres passes et le referer * @author Christophe Beyer <*****@*****.**> * @since 2011/04/08 * @return boolean True si le visiteur est un robot spammeur, true si c'est un humain */ public function isSpam() { $oIsSpam = false; if (!isset($_SERVER["HTTP_REFERER"]) || !$_SERVER["HTTP_REFERER"]) { // Pas de referer $oIsSpam = true; } elseif (CopixRequest::get('url1')) { // Champ en commentaire rempli $oIsSpam = true; } elseif (CopixRequest::get('url2') != 'Abracadabra') { // Champ non visible modifie $oIsSpam = true; } return $oIsSpam; }
public function processGetMultipleSelectContent() { $currentId = null; $classString = CopixSession::get(CopixRequest::get('class')); $arClass = explode('::', $classString); $class = _ioClass($arClass[0]); $values = $class->{$arClass}[1](); $objectMap = CopixRequest::get('objectMap'); if (!empty($objectMap)) { $tab = explode(';', $objectMap); if (count($tab) != 2) { throw new CopixTemplateTagException("[plugin select] parameter 'objectMap' must looks like idProp;captionProp"); } $idProp = $tab[0]; $captionProp = $tab[1]; } $id = CopixRequest::get('idselect'); $name = CopixRequest::get('nameselect'); $toReturn = ''; $compteur = 0; if (empty($objectMap)) { foreach ((array) $values as $key => $caption) { $currentId = uniqid(); $compteur++; $color = $compteur % 2 == 0 ? '#cccccc' : '#ffffff'; $toReturn .= '<div style="width:100%;background-color:' . $color . '"><input type="checkbox" class="check_' . $id . '" id="' . $currentId . '" value="' . $key . '" /><label id="label_' . $currentId . '" for="' . $currentId . '">' . _copix_utf8_htmlentities($caption) . '</label></div>'; } } else { //if given an object mapping request. foreach ((array) $values as $object) { $color = $compteur % 2 == 0 ? '#cccccc' : '#ffffff'; $toReturn .= '<div style="width:100%;background-color:' . $color . '"><input type="checkbox" id="' . $currentId . '" class="check_' . $id . '" value="' . $object->{$idProp} . '" /><label id="label_' . $currentId . '" for="' . $currentId . '">' . _copix_utf8_htmlentities($object->{$captionProp}) . '</label></div>'; } } //CopixSession::set(CopixRequest::get('class'),null); CopixHTMLHeader::addJsCode("\n window.addEvent('domready', function () {\n var input = \$('{$id}');\n \$\$('.check_{$id}').each (function (el) {\n el.addEvent ('change', function () {\n var value = '';\n \$('hidden_{$id}').setHTML('');\n \$\$('.check_{$id}').each ( function (el) {\n if (el.checked) {\n if (value!='') {\n value += ',';\n }\n value += \$('label_'+el.getProperty('id')).innerHTML;\n \$('hidden_{$id}').setHTML (\$('hidden_{$id}').innerHTML+'<input type=\"hidden\" name=\"" . $name . "[]\" value=\"'+el.value+'\" />');\n }\n });\n input.value = value;\n });\n });\n });\n "); return _arDirectPPO(new CopixPPO(array('MAIN' => $toReturn)), 'generictools|blank.tpl'); }