See file /home/sorobane/www/protected/controller/RegistrationController.php


+ Error on line 232

        include_once $_SERVER['DOCUMENT_ROOT']."/protected/view/home/home_template.php";

<?php
class RegistrationController extends DooController {

    
/* This array will hold data we want to expose to the templates we return to users later */
    
protected $data = array('result'=>"");

    
/* This function is called by DooPHP before we run an action */
    
public function beforeRun($resouce$action) {
        
// Get the sites base url i.e. http://localhost/ (includes the / at the end)
        
$this->data['app_url'] = Doo::conf()->APP_URL;
    }

    public function 
forward_lang() {
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        if( 
$user->uid header ("location: /index.php/".$lang."/myspace");
        else {
            if(
$subdomain) {
                if(
$subdomain=='sartu')header ("location: /index.php/eu/login");
                else if(
$subdomain=='acceso')header ("location: /index.php/es/login");
                else if(
$subdomain=='access')header ("location: /index.php/en/login");
                else 
header ("location: /index.php/".$lang."/");
            }else 
header ("location: /index.php/".$lang."/");
        }
    }

    public function 
signup() {
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        if( 
$user->uid header ("location: /index.php/".$lang."/myspace");

        
$issorobanescuela strstr($domain'sorobanenlaescuela');

        
$errorcode= isset($_GET['errorcode'])? $_GET['errorcode']:0;
        
$teasernum= isset($_GET['tn'])? $_GET['tn']:0;
        
$errormess='';
        switch (
$errorcode) {
            case 
0:
                
$errormess='';
                break;
            case 
1:
                
$errormess='El email ya está dado de alta como usuario.';
                break;
            case 
2:
                echo 
"El email no es correcto. Por favor introduce un email correcto.";
                break;
            default: break;
        }

        
/* Set the pages title */
        
$this->data['OK']=false;
        
$this->data['sentF']=false;

        
$this->data['name']="";
        
$this->data['mail']="";
        
$this->data['os']= "winxp";
        
$this->data['pass']= "";
        
$this->data['iamteacher']= "";

        
$this->data['en']=false;
        
$this->data['em']=false;
        
$this->data['ep']=false;
        
$this->data['et']=false;

        
$this->data['errormess']=$errormess;

        
$teasernum $teasernum?$teasernum:rand(2,3);
        
$this->data['templatetorender'] = $issorobanescuela?'registration/signup':('home/teaser'.$teasernum.'_'.$lang);

        
// include_once $_SERVER['DOCUMENT_ROOT']."/protected/view/home/".($issorobanescuela?"home_sele_template.php":"home_template.php");
        
include_once $_SERVER['DOCUMENT_ROOT']."/protected/view/home/".(strstr($domain'sorobanenlaescuela')?"new_homesele_template.php":"new_home_template.php");
    }

    public function 
signup_action() {    
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        
$this->data['name']= isset($_POST['name'])? $_POST['name']:"";
        
$this->data['mail']= isset($_POST['mail'])? $_POST['mail']:"";
        
$this->data['os']= isset($_POST['os'])? $_POST['os']:"winxp";
        
$this->data['pass']= isset($_POST['pass'])? $_POST['pass']:"";
        
$this->data['iamteacher']= isset($_POST['iamteacher'])? $_POST['iamteacher']:0;
        
$this->data['OK']=false;
        
$this->data['sentF']=isset($_POST['sentf'])? $_POST['sentf']:"";

        
$error='';
        
$result='';

        
$this->data['en']=false;
        
$this->data['em']=false;
        
$this->data['ep']=false;
        
$this->data['et']=false;

        if(
$this->data['sentF']){
            if( !
trim($this->data['name']) ) {$error.='<li>'.txt::$t['namerequired'].'.</li>'$en=true;}
            if( !
$aux->valMailtrim($this->data['mail']) ) ) {$error.='<li>'.txt::$t['mailrequired'].'.</li>'$em=true;}
            if( !
trim($this->data['pass']) ) {$error.='<li>'.txt::$t['passrequired'].'.</li>'$ep=true;}
            else if( 
strlen(trim($this->data['pass']))<){$error.='<li>'.txt::$t['pass4chars'].'.</li>'$ep=true;}

            if(!
$error){
                
Doo::loadModel('User');
                
$user = new User;
                
// Assign the user object the requested username
                
$user->name $this->data['name'];
                
$user->mail $this->data['mail'];
                
$result_uDoo::db()->find('user', array('where'=>"name='".$user->name."' OR mail='".$user->mail."'"'limit'=>1) );
                
//print_r($result_u);
                
if($result_u){
                    if( 
$result_u->name ==$this->data['name']) {$error.='<li>'.txt::$t['userused'].'.</li>';  $en=true;}
                    if( 
$result_u->mail ==$this->data['mail']) {$error.='<li>'.txt::$t['mailused'].'.</li>';  $em=true;}
                }
                
                if(
$error$this->data['result'] = '<div class="errores"><span>'.txt::$t['pleasecorrectnexterrors'].':</span><ul>'.$error.'</ul></div>';
                else {
                    
// finish populating the users data
                    
$user->pass $aux->genMD5Password($this->data['pass']);//md5($aux->salt.trim($this->data['pass']));
                    
$user->isteacher $this->data['iamteacher'];                

                    
// Try saving the result
                    
$accountid $this->db()->insert($user);
                    if (
$accountid 0) {
                        try{
                            
$mailresult=$aux->sendMail('info@sorobanenlaescuela.com','','SorobanEnlaEscuela - New invitation required',styleEmail('New invitation required''<p>Username: '.$user->name.'<br />Mail: '.$user->mail.'<br />Password: '.$this->data['pass'].'<br />IsTeacher: '.$user->isteacher.'</p>'),false,null);
                            if(
$mailresult!="1") {echo $mailresult;}
                        }  catch (
Exception $e) {
                            
$output .='Something really gone wrong: '$e;
                        }

                        
$this->data['result'] = '<div class="genial"><span>'.str_replace('{{domain}}''Soroban en la escuela'txt::$t['wellcome']).'!</span><br/>'.txt::$t['welcomeexplanation'].'</div>';
                        
$this->data['OK'] =true;
                    } else {
                        
$this->data['result'] = 'Ooops...hemos tenido un error. Por favor, inténtalo nuevamente.';
                    }                                    
                }
                
            }else 
$this->data['result'] = '<div class="errores"><span>'.txt::$t['pleasecorrectnexterrors'].':</span><ul>'.$error.'</ul></div>';

        }

        
//render
        
$this->data['templatetorender'] = 'registration/signup';    
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/view/template.php";
    }

    public function 
login_action() {
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        if( 
$user->uid ) {
            if(
$aux->isUserExpired()) {header ("location: /index.php/".$lang."/expired"); return ;}
            else {
header ("location: /index.php/".$lang."/".($user->isteacher?($user->uid==1?"panel":"progress"):"myspace")); return ;}
        }
        
$this->data['OK']=false;

        
$error='';
        
/* Set the pages title */        
                //print_r($_POST);
        
$this->data['name'] = isset($_POST['name'])?$_POST['name']:'';
        
$this->data['pass'] = isset($_POST['pass'])?$_POST['pass']:'';
        
$this->data['sentF'] = false;
        
$this->data['sentL'] = isset($_POST['sentl'])?$_POST['sentl']:false;
        
$this->data['result'] = '';

        
$mail= isset($_GET['mail'])? $_GET['mail']:'';

        if(
$this->data['sentL']){        
         if (empty(
$this->data['name']) || empty($this->data['pass'])){
            
$error='<li>'.txt::$t['userpassmustbeentered'].'</li>';
            
$this->data['result'] = '<div class="errores"><ul>'.$error.'</ul></div>';
        }else{
            
// Load the User Model (in public_html\protected\model\User.php)
            
Doo::loadModel('User');
            
$user = new User;
            
$user->name $this->data['name'];
            
$user->pass$aux->genMD5Password($this->data['pass']);//md5($aux->salt.trim($this->data['pass']) );
            
            // Try and find a User with the specified username and password
            //$aUser = Doo::db()->find('user', array('where'=>"name ='".$user->name."' AND pass='".$user->pass."' AND status=1", 'limit'=>1) );
            
$aUser Doo::db()->find('User', array('where'=>"(name ='".$user->name."' OR mail ='".$user->name."') AND pass='".$user->pass."' AND status=1"'limit'=>1) );
            
            
//print_r($aUser);
            
if ($aUser == false) {
                
$this->_application->user null;
                
$error '<li>'.txt::$t['incorrectdata'].'</li>';    
                
$this->data['result'] = '<div class="errores"><ul>'.$error.'</ul></div>';            
            }else{                
                
$this->_application->user $aUser;
                
setcookie('uid',$aUser->uid,time() + (10 365 24 60 60));
                
header ("location: /index.php/".$lang."/myspace");return;
            }
            }
        }

        
//render
        
$this->data['mail'] = $mail;    
        
$this->data['templatetorender'] = 'registration/signup';    
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/view/template.php";
    }

    public function 
logout_action(){
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        
$this->_application->user null;
        
header ("location: /index.php/".$lang."/login");
    }

    public function 
generate_pass_recovery_url(){
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        if( 
$user->uid ) {header ("location: /index.php/".$lang."/myspace"); return ;}
        
$email = isset($_POST['email'])?$_POST['email']:'';
        
$ok=false;
        if(
$email) {            
            if(!
$aux->valMail($email)) $this->data['result'] = forUIMatMessageDiv('La dirección de correo debe ser válida');else $ok=true;
            if(
$ok){
                
Doo::loadModel('User');
                
$aUser=Doo::db()->find('User', array('where'=>"mail ='".$email."'"'limit'=>1) );
                if(
$aUser == false) {$this->data['result'] = forUIMatMessageDiv('La dirección de correo no está registrada. Por favor, ponte en contacto con tu coach.'); $ok=false;}
                else {
                    
$newpassword=$aux->unique_id(2,true,$aUser->name);
                    
$aUser->pass $aux->genMD5Password($newpassword);
                    
Doo::db()->update$aUser );
                    
                    try{
                        
$mailresult=$aux->sendMail($email,'',"Soroban en la escuela - nueva contraseña",styleEmail('Nueva contraseña','Estimad@ '.$aUser->name.',<br /> Esta es tu nueva contraseña: '.$newpassword),false,null);
                        if(
$mailresult!="1") {echo $mailresult$result=false;}
                    }  catch (
Exception $e) { 
                        
$mailresult .='Something really gone wrong: '$e;  
                    }
                }
            }
        }       
        
        
$this->data['templatetorender'] = 'registration/passrecovery';
        
        if(
$ok){            
            
$this->data['templatetorender'] = 'registration/readmail';
        }

        include_once $_SERVER['DOCUMENT_ROOT']."/protected/view/home/home_template.php";

    }

    public function 
thanksemailme(){
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        if( 
$user->uid header ("location: /index.php/".$lang."/myspace");

        
$email= isset($_POST['email'])? $_POST['email']:"";
        
$name= isset($_POST['name'])? $_POST['name']:"";
        
$abtest= isset($_POST['abtest'])? $_POST['abtest']:1;

        if(
$email && $name && $aux->valMail(trim($email)) ){
            
Doo::loadModel('Prospects');
            
Doo::loadModel('User');
            
$aProspectDoo::db()->find('Prospects', array('where'=>"email='".$email."'"'limit'=>1) );
            
$aUserDoo::db()->find('User', array('where'=>"mail='".$email."'"'limit'=>1) );
            if( (!
$aProspect && !$aUser) || ($aProspect && $aUser && $aUser->status==0) ){

                if(!
$aProspect && !$aUser){
                    
$aProspect=new Prospects;
                    
$aProspect->email=$email;
                    
$aProspect->pproid=isset($_COOKIE['pproid'])?$_COOKIE['pproid']:0;
                    
$proid $this->db()->insert($aProspect);

                    
$aUser=new User;
                    
$aUser->name=$name;
                    
$aUser->mail=$email;
                    
$newpassword=$aux->unique_id(2,true,$name);
                    
$aUser->pass $aux->genMD5Password($newpassword);
                    
$expdate=date('Y-m-d 00:00:00',mktime(000date("m")  , date("d")+$aux->maxtryingdaysdate("Y")));
                    
$aUser->expire $expdate;
                    
$aUser->trying 1;
                    
$aUser->status 0;
                    
$aUser->isteacher 1;
                    
$aUser->language $lang;

                    
$fatherid $this->db()->insert($aUser);

                }else {
                    
$newpassword=$aux->unique_id(2,true,$name);
                    
$aUser->pass $aux->genMD5Password($newpassword);
                    
Doo::db()->update$aUser );
                    
$fatherid=$aUser->uid;
                }

                
$aux->userAction($fatherid,$aux->actions['Children Page'],'');

                
$this->data['wonderful']=txt::$t['wonderful'];
                
$this->data['nowchildrendata']=txt::$t['nowchildrendata'];
                
$this->data['sonname']=txt::$t['sonname'];
                
$this->data['age']=txt::$t['age'];
                
$this->data['add']=txt::$t['add'];
                
$this->data['continue']=txt::$t['continue'];
                
$this->data['addanotherson']=txt::$t['addanotherson'];

                
$this->data['fid'] = $fatherid
                
$this->data['fp'] = $newpassword;  
                
$this->data['tos'] = str_replace('{{termslink}}''<a href="/termsservice.php?lang=es" target="tos" onclick="window.open(\'\', \'tos\', \'location=0,scrollbars=1,resizable=no,width=700,height=600\')">'.txt::$t['tos'].'</a>'txt::$t['tosagreesimple']);
                
$this->data['ageoptions'] = '<option value="0" disabled="true" selected="true"> -- </option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option>';
                
$this->data['alertbody'] = formatMessModal();
                
$this->data['NOKmess'] = txt::$t['completeallandaccept'];

                
$this->data['templatetorender'] = 'registration/addstudent';    
                include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/view/template.php";

                
//Send mail
                
try{
                    
$mailresult=$aux->sendMail('info@sorobanencasa.com','','Nuevo prospecto',styleEmail('Nuevo Prospecto Soroban''<p>Se ha dado de alta:</p><p>Uid:'.$fatherid.'</p><p>Email:'.$email.'</p><p>pass:'.$newpassword.'</p>'),false,null);
                    if(
$mailresult!="1") {}
                }  catch (
Exception $e) {
                    echo 
'Something really gone wrong: '$e;
                }

            }else {
header ("location: /index.php/".$lang."/login?mail=".$email); return;}
        }else {
header ("location: /index.php/".$lang."/?errorcode=2#emailme"); return;}

    }
    
    public function 
thanksson(){
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        if( 
$user->uid header ("location: /index.php/".$lang."/myspace");

        
$son= isset($_POST['son'])? $_POST['son']:"";
        
$age= isset($_POST['age'])? $_POST['age']:1;
        
$tos= isset($_POST['tos'])? $_POST['tos']:1;
        
$fid= isset($_POST['fid'])? $_POST['fid']:1;
        
$fp= isset($_POST['fp'])? $_POST['fp']:1;

        
//print_r($son);print_r($age); return;

        
if( $son && $age && $tos && $fid && $fp ){
            
Doo::loadModel('User');
            
Doo::loadModel('AClass');
            
Doo::loadModel('UserProgram');

            
//obtenemos padre
            
$aUserDoo::db()->find('User', array('where'=>"uid=".$fid'limit'=>1) );
            if(
$aUser){
                
$aUser->status=1;
                
Doo::db()->update$aUser );
                
/*$this->_application->user = $aUser;
                setcookie('uid',$aUser->uid,time() + (10 * 365 * 24 * 60 * 60));*/

                //creamos hijos
                
$sonids=array();
                
$studentsdata=array();
                
$sonnames=array();
                foreach (
$son as $key => $ason) if($ason){
                    
$sonUser=new User;
                    
$sonUser->name=$ason;
                    
$sonUser->mail='';
                    
$newpassword=$aux->unique_id(2,true,$ason);
                    
$sonUser->pass $aux->genMD5Password($newpassword);
                    
$expdate=date('Y-m-d 00:00:00',mktime(000date("m")  , date("d")+$aux->maxtryingdaysdate("Y")));
                    
$sonUser->expire $expdate;
                    
$sonUser->trying 1;
                    
$sonUser->status 1;
                    
$sonUser->isteacher 0;
                    
$sonUser->language $lang;
                    
$sonUser->age = isset($age[$key])?$age[$key]:0;

                    
$sonid $this->db()->insert($sonUser);
                    
$sonids[]=$sonid;
                    
$sonnames[]=$ason;
                    
$studentsdata[]=str_replace(array('{{sonname}}','{{susername}}','{{spass}}'), array($ason,$ason,$newpassword), '<p><span style="font-weight: bold;display: block;margin-top:20px;">'.txt::$t['studentaccessdata'].':</span><ul  class="adata">
                        <li><label>'
.txt::$t['username'].':</label>{{susername}}</li>
                        <li><label>'
.txt::$t['pass'].':</label>{{spass}}</li>
                    </ul></p>'
);
                }
                
                
//Create class
                
$aClass=new AClass;
                
$aClass->name="Clase ".$aUser->name;
                
$aClass->teacher=$fid;
                
$aClass->students=','implode(','$sonids).',';
                
                
$cid $this->db()->insert($aClass);

                
//Create Program
                
$aProg=new UserProgram;
                
$aProg->teacher=$fid;
                
$aProg->status=1;
                
$aProg->program=1;
                
$aProg->classes=','.$cid.',';
                
                
$pid $this->db()->insert($aProg);

                
//actualizamos prospecto
                
$aProspectDoo::db()->find('Prospects', array('where'=>"email='".$aUser->mail."'"'limit'=>1) );
                if(
$aProspect) {
                    
$aProspect->father $aUser->uid;
                    
$aProspect->child ','implode(','$sonids).',|,'.implode(','$age).',|';
                    
Doo::db()->update$aProspect );
                }

                
//Renderizamos
                
$this->data['wellcome'] = str_replace('{{domain}}''Soroban en casa'txt::$t['wellcome']);
                
$this->data['havesentmail']='';//txt::$t['havesentmail'];
                
$this->data['nextsteps']='';//txt::$t['nextsteps'];
                
$this->data['nextstepsdesc']='';//str_replace('{{sonname}}', implode(', ',$sonnames),txt::$t['nextstepsdesc']);

                /*$this->data['accessdata_new'] = str_replace(array('{{fusername}}','{{fpass}}'), array($aUser->mail,$fp), '<p><span style="font-weight: bold;display: block;">'.txt::$t['youraccessdata'].':</span><ul class="adata">
                    <li><label>'.txt::$t['username'].':</label>{{fusername}}</li>
                    <li><label>'.txt::$t['pass'].':</label>{{fpass}}</li>
                </ul></p>');
                $this->data['accessdata_new'] .= implode('', $studentsdata);*/

                /*Nuevo mensaje*/
                
$this->data['accessdata'] = '<p>Gracias por registrate en Soroban.<br>Te hemos enviado los datos de acceso. Revisa tu email.</p><p>'.txt::$t['sorobanteam'].'.</p>';

                
$this->data['start'] = txt::$t['accept'];//txt::$t['start'];

                
$this->data['templatetorender'] = 'registration/wellcomefather';    
                include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/view/template.php";

                
$welltitle=str_replace('{{domain}}''"Soroban en casa"'txt::$t['wellcome']);
                
$accessandmove=str_replace(array('{{domain}}','{{domain_name}}'), array('sorobanencasa','Soroban en casa'), txt::$t['accessandmove']);


                try{
                    
/*Datos de acceso*/    
                    
$mailresult=$aux->sendMail($aUser->mail,'info@sorobanencasa.com','Datos '.$welltitle,
                        
styleEmail('Datos '.$welltitle
                            
implode(''$studentsdata).'</p><p>'.$accessandmove.'</p><p>'.txt::$t['sorobanteam'].'.</p>','sorobanencasa'),
                        
false,null);
                    if(
$mailresult!="1") {}
                    
                }  catch (
Exception $e) {
                    echo 
'Something really gone wrong: '$e;
                }

                
$aux->userAction($aUser->uid,$aux->actions['Wellcome User Page'],'');

            }else {
header ("location: /index.php/".$lang."/?errorcode=2"); return;}
        }else {
header ("location: /index.php/".$lang."/thanksemailme?errorcode=1"); return;}

    }

    public function 
thanksreservation(){
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        if( 
$user->uid header ("location: /index.php/".$lang."/myspace");

        
$email= isset($_POST['email'])? $_POST['email']:"";
        
$name= isset($_POST['name'])? $_POST['name']:"";
        
$school= isset($_POST['school'])? $_POST['school']:"";
        
$level= isset($_POST['level'])? $_POST['level']:"";
        
$abtest= isset($_POST['abtest'])? $_POST['abtest']:1;
        
$tos= isset($_POST['tos'])? $_POST['tos']:1;

        if( 
$email && $name && $tos && $school && $level){
            
Doo::loadModel('User');
            
Doo::loadModel('AClass');

            
$aUser=Doo::db()->find('User', array('where'=>"mail ='".$email."'"'limit'=>1) );
            if(
$aUser){
                
            }else{
                
$aUser=new User;
                
$aUser->name=$name;
                
$aUser->mail=$email;
                
$newpassword=$aux->unique_id(2,true,$name);
                
$aUser->pass $aux->genMD5Password($newpassword);
                
$expdate=date('Y-m-d 00:00:00',mktime(000date("m")  , date("d")+$aux->maxtryingdaysdate("Y")));
                
$aUser->expire $expdate;
                
$aUser->trying 0;
                
$aUser->status 1;
                
$aUser->isteacher 0;
                
$aUser->language $lang;

                
$userid $this->db()->insert($aUser);
                if(
$userid){
                     
//Create class
                    
$aClass=Doo::db()->find('AClass', array('where'=>'cid=37','limit'=>1) );
                    if(
$aClass){
                        
$aClass->students ','.$aux->cleanElemList($aClass->students.','.$userid.',').',';
                        
Doo::db()->update$aClass );

                        
$mailbody str_replace(array('{{fusername}}','{{fpass}}'), array($email,$newpassword), '<p><span style="font-weight: bold;display: block;">'.txt::$t['youraccessdata'].':</span><ul class="adata">
                            <li><label>'
.txt::$t['username'].': </label>{{fusername}}</li>
                            <li><label>'
.txt::$t['pass'].': </label>{{fpass}}</li>
                        </ul></p>'
);

                        
$welltitle=str_replace('{{domain}}''"Soroban en la escuela"'txt::$t['wellcome']);
                        
$accessandmove=str_replace(array('{{domain}}','{{domain_name}}'), array('sorobanenlaescuela','Soroban en la escuela'), txt::$t['accessandmove']);

                        try{
                            
/*Datos de acceso*/    
                            
$mailresult=$aux->sendMail($aUser->mail,'info@sorobanencasa.com','Datos '.$welltitle,
                                
styleEmail('Datos '.$welltitle
                                    
$mailbody.'<p>'.$accessandmove.'</p><p>'.txt::$t['sorobanteam'].'.</p>'),
                                
false,null);
                            if(
$mailresult!="1") {}
                            
                        }  catch (
Exception $e) {
                            echo 
'Something really gone wrong: '$e;
                        }
                    }else echo 
'No class detected!';

                }else echo 
'No user created!';
            }
            

            
$this->data['wellcome'] = str_replace('{{domain}}''Soroban en la escuela'txt::$t['wellcome']);
            
$this->data['willsendmail']='<p>Gracias por registrate en Soroban.<br>Te hemos enviado los datos de acceso. Revisa tu email.</p><p>'.txt::$t['sorobanteam'].'.</p>';;
            
$this->data['thanks']='';
        }else {
header ("location: /index.php/".$lang."/"); return;}

        
$this->data['templatetorender'] = 'registration/wellcomeregistration';    
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/view/template.php";
    }

    public function 
expired(){
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        
//$aux->isUserExpired(); return;
        
if( $user->uid && $aux->isUserExpired() ) {
             
//Send mail
            /*try{
                $mailresult=$aux->sendMail('ricardo@enmotionvalue.com','','Usuario expirado',styleEmail('Usuario expirado', '<p>El usuario ha expirado:</p><ul><li>['.$user->uid.'] '.utf8_encode($user->name).'</li><li>'.$user->mail.'</li></ul>'),false,null);
                if($mailresult!="1") {}
            }  catch (Exception $e) {
                echo 'Something really gone wrong: '. $e;
            }*/
        
}else {header ("location: /index.php/".$lang."/error"); return;}

        
$this->data['wewantyoucontinuedesc'] = str_replace("{{lang}}"$langtxt::$t['wewantyoucontinuedesc']);

        
$this->data['templatetorender'] = 'registration/expired';    
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/view/template.php";
    }

    
/* NEW HOME*/
    
public function newhome(){
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";

        if( 
$user->uid header ("location: /index.php/".$lang."/myspace");


        
$this->data['templatetorender'] = strstr($domain'sorobanenlaescuela')?'registration/signup':('home/new_home');

        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/view/home/".(strstr($domain'sorobanenlaescuela')?"new_homesele_template.php":"new_home_template.php");

    }

}


* Stack Trace...

  1. /home/sorobane/www/index.php(31) calling run()
  2. /home/sorobane/dooframework/app/DooWebApp.php(34) calling routeTo()
  3. /home/sorobane/dooframework/app/DooWebApp.php(159) calling generate_pass_recovery_url()
  4. /home/sorobane/www/protected/controller/RegistrationController.php(232) calling generate_pass_recovery_url()


* Variables...  Conf .  GET  .  POST  .  Session  .  Cookie 


object(DooConfig)#1 (24) {
  
["AUTOLOAD"] => NULL
  
["SITE_PATH"] => string(19"/home/sorobane/www/"
  
["PROTECTED_FOLDER"] => string(10"protected/"
  
["BASE_PATH"] => string(28"/home/sorobane/dooframework/"
  
["LOG_PATH"] => NULL
  
["APP_URL"] => string(25"http://sorobanencasa.com/"
  
["SUBFOLDER"] => string(1"/"
  
["APP_MODE"] => string(3"dev"
  
["AUTOROUTE"] => bool(false)
  [
"DEBUG_ENABLED"] => bool(true)
  [
"ERROR_404_DOCUMENT"] => NULL
  
["ERROR_404_ROUTE"] => string(6"/error"
  
["CACHE_PATH"] => NULL
  
["AUTO_VIEW_RENDER_PATH"] => string(12"/es/password"
  
["MEMCACHE"] => NULL
  
["TEMPLATE_ENGINE"] => string(7"DooView"
  
["TEMPLATE_SHOW_COMMENT"] => NULL
  
["TEMPLATE_ALLOW_PHP"] => NULL
  
["TEMPLATE_COMPILE_ALWAYS"] => NULL
  
["TEMPLATE_GLOBAL_TAGS"] => NULL
  
["MODULES"] => NULL
  
["APP_NAMESPACE_ID"] => NULL
  
["CHMOD_DEFAULT"] => int(511)
  [
"FROM_CLI"] => bool(false)
}
DooPHP Diagnostics - include_once(): Failed opening '/home/sorobane/www/protected/view/home/home_template.php' for inclusion (include_path='.:/usr/local/php5.4/lib/php')

See file /home/sorobane/www/protected/controller/RegistrationController.php


+ Error on line 232

        include_once $_SERVER['DOCUMENT_ROOT']."/protected/view/home/home_template.php";

<?php
class RegistrationController extends DooController {

    
/* This array will hold data we want to expose to the templates we return to users later */
    
protected $data = array('result'=>"");

    
/* This function is called by DooPHP before we run an action */
    
public function beforeRun($resouce$action) {
        
// Get the sites base url i.e. http://localhost/ (includes the / at the end)
        
$this->data['app_url'] = Doo::conf()->APP_URL;
    }

    public function 
forward_lang() {
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        if( 
$user->uid header ("location: /index.php/".$lang."/myspace");
        else {
            if(
$subdomain) {
                if(
$subdomain=='sartu')header ("location: /index.php/eu/login");
                else if(
$subdomain=='acceso')header ("location: /index.php/es/login");
                else if(
$subdomain=='access')header ("location: /index.php/en/login");
                else 
header ("location: /index.php/".$lang."/");
            }else 
header ("location: /index.php/".$lang."/");
        }
    }

    public function 
signup() {
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        if( 
$user->uid header ("location: /index.php/".$lang."/myspace");

        
$issorobanescuela strstr($domain'sorobanenlaescuela');

        
$errorcode= isset($_GET['errorcode'])? $_GET['errorcode']:0;
        
$teasernum= isset($_GET['tn'])? $_GET['tn']:0;
        
$errormess='';
        switch (
$errorcode) {
            case 
0:
                
$errormess='';
                break;
            case 
1:
                
$errormess='El email ya está dado de alta como usuario.';
                break;
            case 
2:
                echo 
"El email no es correcto. Por favor introduce un email correcto.";
                break;
            default: break;
        }

        
/* Set the pages title */
        
$this->data['OK']=false;
        
$this->data['sentF']=false;

        
$this->data['name']="";
        
$this->data['mail']="";
        
$this->data['os']= "winxp";
        
$this->data['pass']= "";
        
$this->data['iamteacher']= "";

        
$this->data['en']=false;
        
$this->data['em']=false;
        
$this->data['ep']=false;
        
$this->data['et']=false;

        
$this->data['errormess']=$errormess;

        
$teasernum $teasernum?$teasernum:rand(2,3);
        
$this->data['templatetorender'] = $issorobanescuela?'registration/signup':('home/teaser'.$teasernum.'_'.$lang);

        
// include_once $_SERVER['DOCUMENT_ROOT']."/protected/view/home/".($issorobanescuela?"home_sele_template.php":"home_template.php");
        
include_once $_SERVER['DOCUMENT_ROOT']."/protected/view/home/".(strstr($domain'sorobanenlaescuela')?"new_homesele_template.php":"new_home_template.php");
    }

    public function 
signup_action() {    
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        
$this->data['name']= isset($_POST['name'])? $_POST['name']:"";
        
$this->data['mail']= isset($_POST['mail'])? $_POST['mail']:"";
        
$this->data['os']= isset($_POST['os'])? $_POST['os']:"winxp";
        
$this->data['pass']= isset($_POST['pass'])? $_POST['pass']:"";
        
$this->data['iamteacher']= isset($_POST['iamteacher'])? $_POST['iamteacher']:0;
        
$this->data['OK']=false;
        
$this->data['sentF']=isset($_POST['sentf'])? $_POST['sentf']:"";

        
$error='';
        
$result='';

        
$this->data['en']=false;
        
$this->data['em']=false;
        
$this->data['ep']=false;
        
$this->data['et']=false;

        if(
$this->data['sentF']){
            if( !
trim($this->data['name']) ) {$error.='<li>'.txt::$t['namerequired'].'.</li>'$en=true;}
            if( !
$aux->valMailtrim($this->data['mail']) ) ) {$error.='<li>'.txt::$t['mailrequired'].'.</li>'$em=true;}
            if( !
trim($this->data['pass']) ) {$error.='<li>'.txt::$t['passrequired'].'.</li>'$ep=true;}
            else if( 
strlen(trim($this->data['pass']))<){$error.='<li>'.txt::$t['pass4chars'].'.</li>'$ep=true;}

            if(!
$error){
                
Doo::loadModel('User');
                
$user = new User;
                
// Assign the user object the requested username
                
$user->name $this->data['name'];
                
$user->mail $this->data['mail'];
                
$result_uDoo::db()->find('user', array('where'=>"name='".$user->name."' OR mail='".$user->mail."'"'limit'=>1) );
                
//print_r($result_u);
                
if($result_u){
                    if( 
$result_u->name ==$this->data['name']) {$error.='<li>'.txt::$t['userused'].'.</li>';  $en=true;}
                    if( 
$result_u->mail ==$this->data['mail']) {$error.='<li>'.txt::$t['mailused'].'.</li>';  $em=true;}
                }
                
                if(
$error$this->data['result'] = '<div class="errores"><span>'.txt::$t['pleasecorrectnexterrors'].':</span><ul>'.$error.'</ul></div>';
                else {
                    
// finish populating the users data
                    
$user->pass $aux->genMD5Password($this->data['pass']);//md5($aux->salt.trim($this->data['pass']));
                    
$user->isteacher $this->data['iamteacher'];                

                    
// Try saving the result
                    
$accountid $this->db()->insert($user);
                    if (
$accountid 0) {
                        try{
                            
$mailresult=$aux->sendMail('info@sorobanenlaescuela.com','','SorobanEnlaEscuela - New invitation required',styleEmail('New invitation required''<p>Username: '.$user->name.'<br />Mail: '.$user->mail.'<br />Password: '.$this->data['pass'].'<br />IsTeacher: '.$user->isteacher.'</p>'),false,null);
                            if(
$mailresult!="1") {echo $mailresult;}
                        }  catch (
Exception $e) {
                            
$output .='Something really gone wrong: '$e;
                        }

                        
$this->data['result'] = '<div class="genial"><span>'.str_replace('{{domain}}''Soroban en la escuela'txt::$t['wellcome']).'!</span><br/>'.txt::$t['welcomeexplanation'].'</div>';
                        
$this->data['OK'] =true;
                    } else {
                        
$this->data['result'] = 'Ooops...hemos tenido un error. Por favor, inténtalo nuevamente.';
                    }                                    
                }
                
            }else 
$this->data['result'] = '<div class="errores"><span>'.txt::$t['pleasecorrectnexterrors'].':</span><ul>'.$error.'</ul></div>';

        }

        
//render
        
$this->data['templatetorender'] = 'registration/signup';    
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/view/template.php";
    }

    public function 
login_action() {
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        if( 
$user->uid ) {
            if(
$aux->isUserExpired()) {header ("location: /index.php/".$lang."/expired"); return ;}
            else {
header ("location: /index.php/".$lang."/".($user->isteacher?($user->uid==1?"panel":"progress"):"myspace")); return ;}
        }
        
$this->data['OK']=false;

        
$error='';
        
/* Set the pages title */        
                //print_r($_POST);
        
$this->data['name'] = isset($_POST['name'])?$_POST['name']:'';
        
$this->data['pass'] = isset($_POST['pass'])?$_POST['pass']:'';
        
$this->data['sentF'] = false;
        
$this->data['sentL'] = isset($_POST['sentl'])?$_POST['sentl']:false;
        
$this->data['result'] = '';

        
$mail= isset($_GET['mail'])? $_GET['mail']:'';

        if(
$this->data['sentL']){        
         if (empty(
$this->data['name']) || empty($this->data['pass'])){
            
$error='<li>'.txt::$t['userpassmustbeentered'].'</li>';
            
$this->data['result'] = '<div class="errores"><ul>'.$error.'</ul></div>';
        }else{
            
// Load the User Model (in public_html\protected\model\User.php)
            
Doo::loadModel('User');
            
$user = new User;
            
$user->name $this->data['name'];
            
$user->pass$aux->genMD5Password($this->data['pass']);//md5($aux->salt.trim($this->data['pass']) );
            
            // Try and find a User with the specified username and password
            //$aUser = Doo::db()->find('user', array('where'=>"name ='".$user->name."' AND pass='".$user->pass."' AND status=1", 'limit'=>1) );
            
$aUser Doo::db()->find('User', array('where'=>"(name ='".$user->name."' OR mail ='".$user->name."') AND pass='".$user->pass."' AND status=1"'limit'=>1) );
            
            
//print_r($aUser);
            
if ($aUser == false) {
                
$this->_application->user null;
                
$error '<li>'.txt::$t['incorrectdata'].'</li>';    
                
$this->data['result'] = '<div class="errores"><ul>'.$error.'</ul></div>';            
            }else{                
                
$this->_application->user $aUser;
                
setcookie('uid',$aUser->uid,time() + (10 365 24 60 60));
                
header ("location: /index.php/".$lang."/myspace");return;
            }
            }
        }

        
//render
        
$this->data['mail'] = $mail;    
        
$this->data['templatetorender'] = 'registration/signup';    
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/view/template.php";
    }

    public function 
logout_action(){
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        
$this->_application->user null;
        
header ("location: /index.php/".$lang."/login");
    }

    public function 
generate_pass_recovery_url(){
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        if( 
$user->uid ) {header ("location: /index.php/".$lang."/myspace"); return ;}
        
$email = isset($_POST['email'])?$_POST['email']:'';
        
$ok=false;
        if(
$email) {            
            if(!
$aux->valMail($email)) $this->data['result'] = forUIMatMessageDiv('La dirección de correo debe ser válida');else $ok=true;
            if(
$ok){
                
Doo::loadModel('User');
                
$aUser=Doo::db()->find('User', array('where'=>"mail ='".$email."'"'limit'=>1) );
                if(
$aUser == false) {$this->data['result'] = forUIMatMessageDiv('La dirección de correo no está registrada. Por favor, ponte en contacto con tu coach.'); $ok=false;}
                else {
                    
$newpassword=$aux->unique_id(2,true,$aUser->name);
                    
$aUser->pass $aux->genMD5Password($newpassword);
                    
Doo::db()->update$aUser );
                    
                    try{
                        
$mailresult=$aux->sendMail($email,'',"Soroban en la escuela - nueva contraseña",styleEmail('Nueva contraseña','Estimad@ '.$aUser->name.',<br /> Esta es tu nueva contraseña: '.$newpassword),false,null);
                        if(
$mailresult!="1") {echo $mailresult$result=false;}
                    }  catch (
Exception $e) { 
                        
$mailresult .='Something really gone wrong: '$e;  
                    }
                }
            }
        }       
        
        
$this->data['templatetorender'] = 'registration/passrecovery';
        
        if(
$ok){            
            
$this->data['templatetorender'] = 'registration/readmail';
        }

        include_once $_SERVER['DOCUMENT_ROOT']."/protected/view/home/home_template.php";

    }

    public function 
thanksemailme(){
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        if( 
$user->uid header ("location: /index.php/".$lang."/myspace");

        
$email= isset($_POST['email'])? $_POST['email']:"";
        
$name= isset($_POST['name'])? $_POST['name']:"";
        
$abtest= isset($_POST['abtest'])? $_POST['abtest']:1;

        if(
$email && $name && $aux->valMail(trim($email)) ){
            
Doo::loadModel('Prospects');
            
Doo::loadModel('User');
            
$aProspectDoo::db()->find('Prospects', array('where'=>"email='".$email."'"'limit'=>1) );
            
$aUserDoo::db()->find('User', array('where'=>"mail='".$email."'"'limit'=>1) );
            if( (!
$aProspect && !$aUser) || ($aProspect && $aUser && $aUser->status==0) ){

                if(!
$aProspect && !$aUser){
                    
$aProspect=new Prospects;
                    
$aProspect->email=$email;
                    
$aProspect->pproid=isset($_COOKIE['pproid'])?$_COOKIE['pproid']:0;
                    
$proid $this->db()->insert($aProspect);

                    
$aUser=new User;
                    
$aUser->name=$name;
                    
$aUser->mail=$email;
                    
$newpassword=$aux->unique_id(2,true,$name);
                    
$aUser->pass $aux->genMD5Password($newpassword);
                    
$expdate=date('Y-m-d 00:00:00',mktime(000date("m")  , date("d")+$aux->maxtryingdaysdate("Y")));
                    
$aUser->expire $expdate;
                    
$aUser->trying 1;
                    
$aUser->status 0;
                    
$aUser->isteacher 1;
                    
$aUser->language $lang;

                    
$fatherid $this->db()->insert($aUser);

                }else {
                    
$newpassword=$aux->unique_id(2,true,$name);
                    
$aUser->pass $aux->genMD5Password($newpassword);
                    
Doo::db()->update$aUser );
                    
$fatherid=$aUser->uid;
                }

                
$aux->userAction($fatherid,$aux->actions['Children Page'],'');

                
$this->data['wonderful']=txt::$t['wonderful'];
                
$this->data['nowchildrendata']=txt::$t['nowchildrendata'];
                
$this->data['sonname']=txt::$t['sonname'];
                
$this->data['age']=txt::$t['age'];
                
$this->data['add']=txt::$t['add'];
                
$this->data['continue']=txt::$t['continue'];
                
$this->data['addanotherson']=txt::$t['addanotherson'];

                
$this->data['fid'] = $fatherid
                
$this->data['fp'] = $newpassword;  
                
$this->data['tos'] = str_replace('{{termslink}}''<a href="/termsservice.php?lang=es" target="tos" onclick="window.open(\'\', \'tos\', \'location=0,scrollbars=1,resizable=no,width=700,height=600\')">'.txt::$t['tos'].'</a>'txt::$t['tosagreesimple']);
                
$this->data['ageoptions'] = '<option value="0" disabled="true" selected="true"> -- </option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option>';
                
$this->data['alertbody'] = formatMessModal();
                
$this->data['NOKmess'] = txt::$t['completeallandaccept'];

                
$this->data['templatetorender'] = 'registration/addstudent';    
                include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/view/template.php";

                
//Send mail
                
try{
                    
$mailresult=$aux->sendMail('info@sorobanencasa.com','','Nuevo prospecto',styleEmail('Nuevo Prospecto Soroban''<p>Se ha dado de alta:</p><p>Uid:'.$fatherid.'</p><p>Email:'.$email.'</p><p>pass:'.$newpassword.'</p>'),false,null);
                    if(
$mailresult!="1") {}
                }  catch (
Exception $e) {
                    echo 
'Something really gone wrong: '$e;
                }

            }else {
header ("location: /index.php/".$lang."/login?mail=".$email); return;}
        }else {
header ("location: /index.php/".$lang."/?errorcode=2#emailme"); return;}

    }
    
    public function 
thanksson(){
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        if( 
$user->uid header ("location: /index.php/".$lang."/myspace");

        
$son= isset($_POST['son'])? $_POST['son']:"";
        
$age= isset($_POST['age'])? $_POST['age']:1;
        
$tos= isset($_POST['tos'])? $_POST['tos']:1;
        
$fid= isset($_POST['fid'])? $_POST['fid']:1;
        
$fp= isset($_POST['fp'])? $_POST['fp']:1;

        
//print_r($son);print_r($age); return;

        
if( $son && $age && $tos && $fid && $fp ){
            
Doo::loadModel('User');
            
Doo::loadModel('AClass');
            
Doo::loadModel('UserProgram');

            
//obtenemos padre
            
$aUserDoo::db()->find('User', array('where'=>"uid=".$fid'limit'=>1) );
            if(
$aUser){
                
$aUser->status=1;
                
Doo::db()->update$aUser );
                
/*$this->_application->user = $aUser;
                setcookie('uid',$aUser->uid,time() + (10 * 365 * 24 * 60 * 60));*/

                //creamos hijos
                
$sonids=array();
                
$studentsdata=array();
                
$sonnames=array();
                foreach (
$son as $key => $ason) if($ason){
                    
$sonUser=new User;
                    
$sonUser->name=$ason;
                    
$sonUser->mail='';
                    
$newpassword=$aux->unique_id(2,true,$ason);
                    
$sonUser->pass $aux->genMD5Password($newpassword);
                    
$expdate=date('Y-m-d 00:00:00',mktime(000date("m")  , date("d")+$aux->maxtryingdaysdate("Y")));
                    
$sonUser->expire $expdate;
                    
$sonUser->trying 1;
                    
$sonUser->status 1;
                    
$sonUser->isteacher 0;
                    
$sonUser->language $lang;
                    
$sonUser->age = isset($age[$key])?$age[$key]:0;

                    
$sonid $this->db()->insert($sonUser);
                    
$sonids[]=$sonid;
                    
$sonnames[]=$ason;
                    
$studentsdata[]=str_replace(array('{{sonname}}','{{susername}}','{{spass}}'), array($ason,$ason,$newpassword), '<p><span style="font-weight: bold;display: block;margin-top:20px;">'.txt::$t['studentaccessdata'].':</span><ul  class="adata">
                        <li><label>'
.txt::$t['username'].':</label>{{susername}}</li>
                        <li><label>'
.txt::$t['pass'].':</label>{{spass}}</li>
                    </ul></p>'
);
                }
                
                
//Create class
                
$aClass=new AClass;
                
$aClass->name="Clase ".$aUser->name;
                
$aClass->teacher=$fid;
                
$aClass->students=','implode(','$sonids).',';
                
                
$cid $this->db()->insert($aClass);

                
//Create Program
                
$aProg=new UserProgram;
                
$aProg->teacher=$fid;
                
$aProg->status=1;
                
$aProg->program=1;
                
$aProg->classes=','.$cid.',';
                
                
$pid $this->db()->insert($aProg);

                
//actualizamos prospecto
                
$aProspectDoo::db()->find('Prospects', array('where'=>"email='".$aUser->mail."'"'limit'=>1) );
                if(
$aProspect) {
                    
$aProspect->father $aUser->uid;
                    
$aProspect->child ','implode(','$sonids).',|,'.implode(','$age).',|';
                    
Doo::db()->update$aProspect );
                }

                
//Renderizamos
                
$this->data['wellcome'] = str_replace('{{domain}}''Soroban en casa'txt::$t['wellcome']);
                
$this->data['havesentmail']='';//txt::$t['havesentmail'];
                
$this->data['nextsteps']='';//txt::$t['nextsteps'];
                
$this->data['nextstepsdesc']='';//str_replace('{{sonname}}', implode(', ',$sonnames),txt::$t['nextstepsdesc']);

                /*$this->data['accessdata_new'] = str_replace(array('{{fusername}}','{{fpass}}'), array($aUser->mail,$fp), '<p><span style="font-weight: bold;display: block;">'.txt::$t['youraccessdata'].':</span><ul class="adata">
                    <li><label>'.txt::$t['username'].':</label>{{fusername}}</li>
                    <li><label>'.txt::$t['pass'].':</label>{{fpass}}</li>
                </ul></p>');
                $this->data['accessdata_new'] .= implode('', $studentsdata);*/

                /*Nuevo mensaje*/
                
$this->data['accessdata'] = '<p>Gracias por registrate en Soroban.<br>Te hemos enviado los datos de acceso. Revisa tu email.</p><p>'.txt::$t['sorobanteam'].'.</p>';

                
$this->data['start'] = txt::$t['accept'];//txt::$t['start'];

                
$this->data['templatetorender'] = 'registration/wellcomefather';    
                include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/view/template.php";

                
$welltitle=str_replace('{{domain}}''"Soroban en casa"'txt::$t['wellcome']);
                
$accessandmove=str_replace(array('{{domain}}','{{domain_name}}'), array('sorobanencasa','Soroban en casa'), txt::$t['accessandmove']);


                try{
                    
/*Datos de acceso*/    
                    
$mailresult=$aux->sendMail($aUser->mail,'info@sorobanencasa.com','Datos '.$welltitle,
                        
styleEmail('Datos '.$welltitle
                            
implode(''$studentsdata).'</p><p>'.$accessandmove.'</p><p>'.txt::$t['sorobanteam'].'.</p>','sorobanencasa'),
                        
false,null);
                    if(
$mailresult!="1") {}
                    
                }  catch (
Exception $e) {
                    echo 
'Something really gone wrong: '$e;
                }

                
$aux->userAction($aUser->uid,$aux->actions['Wellcome User Page'],'');

            }else {
header ("location: /index.php/".$lang."/?errorcode=2"); return;}
        }else {
header ("location: /index.php/".$lang."/thanksemailme?errorcode=1"); return;}

    }

    public function 
thanksreservation(){
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        if( 
$user->uid header ("location: /index.php/".$lang."/myspace");

        
$email= isset($_POST['email'])? $_POST['email']:"";
        
$name= isset($_POST['name'])? $_POST['name']:"";
        
$school= isset($_POST['school'])? $_POST['school']:"";
        
$level= isset($_POST['level'])? $_POST['level']:"";
        
$abtest= isset($_POST['abtest'])? $_POST['abtest']:1;
        
$tos= isset($_POST['tos'])? $_POST['tos']:1;

        if( 
$email && $name && $tos && $school && $level){
            
Doo::loadModel('User');
            
Doo::loadModel('AClass');

            
$aUser=Doo::db()->find('User', array('where'=>"mail ='".$email."'"'limit'=>1) );
            if(
$aUser){
                
            }else{
                
$aUser=new User;
                
$aUser->name=$name;
                
$aUser->mail=$email;
                
$newpassword=$aux->unique_id(2,true,$name);
                
$aUser->pass $aux->genMD5Password($newpassword);
                
$expdate=date('Y-m-d 00:00:00',mktime(000date("m")  , date("d")+$aux->maxtryingdaysdate("Y")));
                
$aUser->expire $expdate;
                
$aUser->trying 0;
                
$aUser->status 1;
                
$aUser->isteacher 0;
                
$aUser->language $lang;

                
$userid $this->db()->insert($aUser);
                if(
$userid){
                     
//Create class
                    
$aClass=Doo::db()->find('AClass', array('where'=>'cid=37','limit'=>1) );
                    if(
$aClass){
                        
$aClass->students ','.$aux->cleanElemList($aClass->students.','.$userid.',').',';
                        
Doo::db()->update$aClass );

                        
$mailbody str_replace(array('{{fusername}}','{{fpass}}'), array($email,$newpassword), '<p><span style="font-weight: bold;display: block;">'.txt::$t['youraccessdata'].':</span><ul class="adata">
                            <li><label>'
.txt::$t['username'].': </label>{{fusername}}</li>
                            <li><label>'
.txt::$t['pass'].': </label>{{fpass}}</li>
                        </ul></p>'
);

                        
$welltitle=str_replace('{{domain}}''"Soroban en la escuela"'txt::$t['wellcome']);
                        
$accessandmove=str_replace(array('{{domain}}','{{domain_name}}'), array('sorobanenlaescuela','Soroban en la escuela'), txt::$t['accessandmove']);

                        try{
                            
/*Datos de acceso*/    
                            
$mailresult=$aux->sendMail($aUser->mail,'info@sorobanencasa.com','Datos '.$welltitle,
                                
styleEmail('Datos '.$welltitle
                                    
$mailbody.'<p>'.$accessandmove.'</p><p>'.txt::$t['sorobanteam'].'.</p>'),
                                
false,null);
                            if(
$mailresult!="1") {}
                            
                        }  catch (
Exception $e) {
                            echo 
'Something really gone wrong: '$e;
                        }
                    }else echo 
'No class detected!';

                }else echo 
'No user created!';
            }
            

            
$this->data['wellcome'] = str_replace('{{domain}}''Soroban en la escuela'txt::$t['wellcome']);
            
$this->data['willsendmail']='<p>Gracias por registrate en Soroban.<br>Te hemos enviado los datos de acceso. Revisa tu email.</p><p>'.txt::$t['sorobanteam'].'.</p>';;
            
$this->data['thanks']='';
        }else {
header ("location: /index.php/".$lang."/"); return;}

        
$this->data['templatetorender'] = 'registration/wellcomeregistration';    
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/view/template.php";
    }

    public function 
expired(){
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";
        
//$aux->isUserExpired(); return;
        
if( $user->uid && $aux->isUserExpired() ) {
             
//Send mail
            /*try{
                $mailresult=$aux->sendMail('ricardo@enmotionvalue.com','','Usuario expirado',styleEmail('Usuario expirado', '<p>El usuario ha expirado:</p><ul><li>['.$user->uid.'] '.utf8_encode($user->name).'</li><li>'.$user->mail.'</li></ul>'),false,null);
                if($mailresult!="1") {}
            }  catch (Exception $e) {
                echo 'Something really gone wrong: '. $e;
            }*/
        
}else {header ("location: /index.php/".$lang."/error"); return;}

        
$this->data['wewantyoucontinuedesc'] = str_replace("{{lang}}"$langtxt::$t['wewantyoucontinuedesc']);

        
$this->data['templatetorender'] = 'registration/expired';    
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/view/template.php";
    }

    
/* NEW HOME*/
    
public function newhome(){
        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/controller/include_aux.php";

        if( 
$user->uid header ("location: /index.php/".$lang."/myspace");


        
$this->data['templatetorender'] = strstr($domain'sorobanenlaescuela')?'registration/signup':('home/new_home');

        include_once 
$_SERVER['DOCUMENT_ROOT']."/protected/view/home/".(strstr($domain'sorobanenlaescuela')?"new_homesele_template.php":"new_home_template.php");

    }

}


* Stack Trace...

  1. /home/sorobane/www/index.php(31) calling run()
  2. /home/sorobane/dooframework/app/DooWebApp.php(34) calling routeTo()
  3. /home/sorobane/dooframework/app/DooWebApp.php(159) calling generate_pass_recovery_url()
  4. /home/sorobane/www/protected/controller/RegistrationController.php(232) calling generate_pass_recovery_url()


* Variables...  Conf .  GET  .  POST  .  Session  .  Cookie 


object(DooConfig)#1 (24) {
  
["AUTOLOAD"] => NULL
  
["SITE_PATH"] => string(19"/home/sorobane/www/"
  
["PROTECTED_FOLDER"] => string(10"protected/"
  
["BASE_PATH"] => string(28"/home/sorobane/dooframework/"
  
["LOG_PATH"] => NULL
  
["APP_URL"] => string(25"http://sorobanencasa.com/"
  
["SUBFOLDER"] => string(1"/"
  
["APP_MODE"] => string(3"dev"
  
["AUTOROUTE"] => bool(false)
  [
"DEBUG_ENABLED"] => bool(true)
  [
"ERROR_404_DOCUMENT"] => NULL
  
["ERROR_404_ROUTE"] => string(6"/error"
  
["CACHE_PATH"] => NULL
  
["AUTO_VIEW_RENDER_PATH"] => string(12"/es/password"
  
["MEMCACHE"] => NULL
  
["TEMPLATE_ENGINE"] => string(7"DooView"
  
["TEMPLATE_SHOW_COMMENT"] => NULL
  
["TEMPLATE_ALLOW_PHP"] => NULL
  
["TEMPLATE_COMPILE_ALWAYS"] => NULL
  
["TEMPLATE_GLOBAL_TAGS"] => NULL
  
["MODULES"] => NULL
  
["APP_NAMESPACE_ID"] => NULL
  
["CHMOD_DEFAULT"] => int(511)
  [
"FROM_CLI"] => bool(false)
}
$_SESSION Variables array(1) {
  [
"sorobanenlaescuela.com"] => array(2) {
    [
"session_id"] =>   string(32"a3acc800e93195ef401a5f720b64843c"
    
["lang"] =>   string(2"es"
  
}
}
$_COOKIE Variables array(1) {
  [
"start"] => string(11"R3918393780"
}