function _createContent(&$toReturn)
 {
     //Création du sous template.
     $tpl =& new CopixTpl();
     //require_once (COPIX_MODULE_PATH.'cms/'.COPIX_CLASSES_DIR.'cmsworkflow.class.php');
     require_once COPIX_MODULE_PATH . 'cms/' . COPIX_CLASSES_DIR . 'cmspage.services.class.php';
     CopixContext::push('cms');
     $sHeadings =& CopixClassesFactory::instanceOf('copixheadings|CopixHeadingsServices');
     $headings = $sHeadings->getTree();
     $cmsPages =& new ServicesCMSPage();
     $pages = $cmsPages->getList();
     if (isset($this->params['onlyLastVersion']) && $this->params['onlyLastVersion'] == 1) {
         $pages = $this->_filterLastVersion($pages);
     }
     CopixContext::pop();
     //pagination
     foreach ($pages as $page) {
         $arPages[$page->id_head][] = $page;
     }
     $tpl->assign('arPublished', $arPages);
     $tpl->assign('arHeadings', $headings);
     $tpl->assign('select', $this->params['select']);
     $tpl->assign('back', $this->params['back']);
     $tpl->assign('popup', $this->params['popup']);
     $tpl->assign('height', Copixconfig::get('htmleditor|height'));
     $tpl->assign('width', Copixconfig::get('htmleditor|width'));
     $tpl->assign('editorType', CopixConfig::get('htmleditor|type'));
     $tpl->assign('editorName', $this->params['editorName']);
     $toReturn = $tpl->fetch('page.select.ptpl');
     return true;
 }
 public function _createContent(&$toReturn)
 {
     //Création du sous template.
     $tpl = new CopixTpl();
     CopixClassesFactory::fileInclude('cms|ServicesCMSPage');
     CopixContext::push('cms');
     $sHeadings = CopixClassesFactory::getInstanceOf('copixheadings|CopixHeadingsServices');
     $headings = $sHeadings->getTree();
     $cmsPages = new ServicesCMSPage();
     $pages = $cmsPages->getList();
     if (isset($this->_params['onlyLastVersion']) && $this->_params['onlyLastVersion'] == 1) {
         $pages = $this->_filterLastVersion($pages);
     }
     CopixContext::pop();
     //pagination
     foreach ($pages as $page) {
         $arPages[$page->id_head][] = $page;
     }
     $tpl->assign('arPublished', $arPages);
     $tpl->assign('arHeadings', $headings);
     $tpl->assign('select', $this->getParam('select'));
     $tpl->assign('back', $this->getParam('back'));
     $tpl->assign('popup', $this->getParam('popup'));
     $tpl->assign('height', Copixconfig::get('htmleditor|height'));
     $tpl->assign('width', Copixconfig::get('htmleditor|width'));
     //$tpl->assign ('editorType' , CopixConfig::get('htmleditor|type'));
     $tpl->assign('editorName', $this->getParam('editorName'));
     $toReturn = $tpl->fetch('page.select.ptpl');
     return true;
 }
 /**
  * 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');
 }
 /**
  * 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(''));
 }