<?php
/***************************************************************************
- * Copyright (C) 2003-2008 Polytechnique.org *
+ * Copyright (C) 2003-2009 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
}
require_once('emails.inc.php');
- $redirect = new Redirect($uid);
+ $user = User::getSilent($uid);
+ $redirect = new Redirect($user);
$redirect->add_email($email);
// on cree un objet logger et on log l'inscription
// update number of subscribers (perms has changed)
$globals->updateNbIns();
- if (!start_connexion($uid, false)) {
+ if (!Platal::session()->startWeakSession($uid)) {
return PL_FORBIDDEN;
}
- $_SESSION['auth'] = AUTH_MDP;
/***********************************************************/
/************* envoi d'un mail au démarcheur ***************/
. " - forlife : $forlife\n"
. " - email : $email\n"
. " - sexe : $femme\n"
- . " - ip : {$logger->ip} ({$logger->host})\n"
- . ($logger->proxy_ip ? " - proxy : {$logger->proxy_ip} ({$logger->proxy_host})\n" : "")
+ . " - ip : " . S::logger()->ip . " (" . S::logger()->host . ")\n"
+ . (S::logger()->proxy_ip ? " - proxy : " . S::logger()->proxy_ip . " (" . S::logger()->proxy_host . ")\n" : "")
. "\n\n";
if (count($market) > 0) {
$msg .= "Les marketings suivants avaient été effectués :\n"
. implode("\n", $market);
} else {
- $msg .= "$prenom $nom n'a jamais reçu d\'email de marketing.";
+ $msg .= "$prenom $nom n'a jamais reçu d'email de marketing.";
}
$mymail->setTxtBody($msg);
$mymail->send();
{
global $globals;
$page->changeTpl('register/success.tpl');
+ $page->assign('user', S::user());
$_SESSION['sub_state'] = array('step' => 5);
if (Env::has('response2')) {
S::v('uid'));
// If GoogleApps is enabled, and the user did choose to use synchronized passwords,
- // and if the (stupid) user has decided to user /register/success another time,
+ // and if the (stupid) user has decided to use /register/success another time,
// updates the Google Apps password as well.
if ($globals->mailstorage->googleapps_domain) {
require_once 'googleapps.inc.php';
- $account = new GoogleAppsAccount(S::v('uid'), S::v('forlife'));
+ $account = new GoogleAppsAccount(S::user());
if ($account->active() && $account->sync_password) {
$account->set_password($password);
}
}
- $log = S::v('log');
- S::logger()->log('passwd', '');
-
- if (Cookie::v('ORGaccess')) {
- require_once('secure_hash.inc.php');
- setcookie('ORGaccess', hash_encrypt($password), (time()+25920000), '/', '' ,0);
- }
+ S::logger()->log('passwd');
+ Platal::session()->setAccessCookie(true);
$page->assign('mdpok', true);
}
}
if (Post::v('imap')) {
require_once 'emails.inc.php';
- $storage = new EmailStorage(S::v('uid'), 'imap');
+ $user = S::user();
+ $storage = new EmailStorage($user, 'imap');
$storage->activate();
}