Пример #1
0
  public function executeAddConfirm(sfWebRequest $request)
  {
    
    $this->class = Doctrine::getTable('dsClass')->findOneById($this->class->id);
    $this->person = $this->getRoute()->getObject();
    
    // prepare the form
    $this->form = new dsClassStudentAddConfirmForm();
    $this->form->setDefault('fee', $this->person->getIsStudent() ? $this->class->getFeeReduced() : $this->class->getFee() );

    $message = csSettings::get('message.confirm');
    $this->form->setDefault('message', $message );
    
    $this->form->setDefault('fee', $this->person->getIsStudent() ? $this->class->getFeeReduced() : $this->class->getFee() );
  
    if ($request->isMethod(sfRequest::POST)) {
      
      $form = $this->form;
      
      $form->bind($this->getRequest()->getParameter($form->getName()) );
      if ($form->isValid())
      {
                
        // todo: make transaction !!
        
       // $enrollment = $this->class->enroll( $person, $role, $message );
        
        $this->getUser()->setFlash('notice', sprintf('%s has been confirmed to the class.', $this->person ));
        $this->redirect('ds_class_students');
                
        
      } else {
        
        $this->getUser()->setFlash('error', sprintf('An error occured. Please try again.', null ));
        
      }
    
    }    
    
    //Doctrine::getTable('dsClass')->findOneById($this->class_id));
    
  }
    public function sendMailValidation($email)
    {
        $user = sfContext::getInstance()->getUser()->getUsername();
        $url = csSettings::get('baseurl');
        $token = sha1(sfContext::getInstance()->getUser()->getUsername() . $email);
        $message = sfContext::getInstance()->getMailer()->compose(array(csSettings::get('email') => csSettings::get('email_nom')), $email, '[' . csSettings::get('email_prefixe') . '] Validation de votre nouvelle adresse mail', <<<EOF
Bonjour,

Vous venez de changer votre adresse mail sur COPIsim. Pour valider le changement d'adresse e-mail, nous vous prions de bien vouloir aller sur le lien suivant :

{$url}etudiant/mail/{$user}/{$token}

Merci.

L'administration.
Ce message a été généré automatiquement, merci de ne pas y répondre.
EOF
);
        sfContext::getInstance()->getMailer()->send($message);
    }
Пример #3
0
?>
    <?php 
include_javascripts();
?>
  </head>
  <body>
    <div id="container">
      <div id="header">
	<span id="titre"><a href="<?php 
echo url_for('@homepage');
?>
"><?php 
echo image_tag('copisim_logo.png', 'alt=COPIsim');
?>
<h1> <?php 
echo csSettings::get('titre_du_site');
?>
</h1></a></span>
	  
	<span id="menu">
	  <ul>
	      <li><a href="<?php 
echo url_for('copisim_periode/index');
?>
">Periode</a></li>
				<li><a href="<?php 
echo url_for('copisim_poste/index');
?>
">Poste</a></li>
				<li><a href="<?php 
echo url_for('copisim_fac/index');