Esempio n. 1
0
 /**
  * Declares class-based actions.
  */
 public function actions()
 {
     $captcha = array('class' => 'CaptchaExtendedAction', 'mode' => CaptchaExtendedAction::MODE_WORDS);
     //ajout de fixed value si mode de dev
     if (CommonTools::isInDevMode()) {
         $captchaplus = array('fixedVerifyCode' => "nicolas");
         $captcha = array_merge($captcha, $captchaplus);
     }
     return array('captcha' => $captcha, 'page' => array('class' => 'CViewAction'));
 }
Esempio n. 2
0
<footer>
    <div style="text-align:center;background-color: white;">
        Copyright Inserm - Version 1.6 alpha rev. <?php 
include 'revision_number.php';
?>
- Project Biobanques <a href="http://www.biobanques.eu">www.biobanques.eu</a>
    </div>
</footer>

<?php 
if (!CommonTools::isInDevMode()) {
    ?>
    <!-- code google analytics pour tracking du suivi -->
    <script type="text/javascript">

        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-44379278-1']);
        _gaq.push(['_trackPageview']);

        (function () {
            var ga = document.createElement('script');
            ga.type = 'text/javascript';
            ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(ga, s);
        })();

    </script>
    <?php 
}
 /**
  * testing method to check if the dev mode detector is ok
  */
 public function testIsInDevMode()
 {
     $this->assertTrue(CommonTools::isInDevMode());
 }
Esempio n. 4
0
 /**
  * send an email to indicate to the admin that there is a new user to confirm
  * @param type $user
  * @return type
  */
 public static function sendSubscribeAdminMail($user)
 {
     $base = CommonTools::isInDevMode() ? CommonMailer::DEV_URL : CommonMailer::PROD_URL;
     $to = Yii::app()->params['adminEmail'];
     $subject = "Inscription d'un nouvel utilisateur sur ebiobanques.fr";
     $userDetails = '';
     foreach ($user->getAttributes() as $label => $value) {
         $userDetails .= "<li>{$label} : {$value}</li>";
     }
     $body = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd\">\n\t\t\t\t<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\t\t\t\t<html><head>\n\t\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\t<title>Inscription d'un nouvel utilisateur sur ebiobanques.fr</title>\n\t\t\t\t</head><body>\n\t\t\t\t{$user->prenom} {$user->nom} s'est inscrit sur le site ebiobanques.fr.<br>\n\t\t\t\t\t\tDétails :<br>\n\t<ul>{$userDetails}</ul><br>\n\tVous pouvez valider cet utilisateur en cliquant sur ce lien : <a href={$base}/index.php/user/validate/id/{$user->_id}\">Valider l'utilisateur</a>, le <a href={$base}/index.php/user/refuseRegistration/id/{$user->_id}\">désactiver</a>\n\t ou le retrouver dans <a href={$base}/index.php/user/admin\">la liste des utilisateurs</a>.\n\t</body>\n\t\t";
     return CommonMailer::sendMail($to, $subject, $body);
 }