projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a class Group to handler xnet groups.
[platal.git]
/
modules
/
register.php
diff --git
a/modules/register.php
b/modules/register.php
index
8d30088
..
7c145fb
100644
(file)
--- a/
modules/register.php
+++ b/
modules/register.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-200
8
Polytechnique.org *
+ * Copyright (C) 2003-200
9
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-297,7
+297,8
@@
class RegisterModule extends PLModule
}
require_once('emails.inc.php');
}
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
$redirect->add_email($email);
// on cree un objet logger et on log l'inscription
@@
-323,8
+324,10
@@
class RegisterModule extends PLModule
$p_for = 'xorg.promo.x' . $promo;
$cible = array('xorg.general', 'xorg.pa.divers', 'xorg.pa.logements', $p_for);
foreach ($cible as $val) {
$p_for = 'xorg.promo.x' . $promo;
$cible = array('xorg.general', 'xorg.pa.divers', 'xorg.pa.logements', $p_for);
foreach ($cible as $val) {
- XDB::execute("INSERT INTO forums.abos (fid,uid)
- SELECT fid, {?} FROM forums.list WHERE nom={?}", $uid, $val);
+ XDB::execute('INSERT INTO forum_subs (fid,uid)
+ SELECT fid, {?}
+ FROM forum
+ WHERE name = {?}', $uid, $val);
if (XDB::affectedRows() == 0 && $val == $p_for) {
$res = XDB::query("SELECT SUM(perms IN ('admin','user') AND deces = 0), COUNT(*)
FROM auth_user_md5
if (XDB::affectedRows() == 0 && $val == $p_for) {
$res = XDB::query("SELECT SUM(perms IN ('admin','user') AND deces = 0), COUNT(*)
FROM auth_user_md5
@@
-341,10
+344,9
@@
class RegisterModule extends PLModule
// update number of subscribers (perms has changed)
$globals->updateNbIns();
// update number of subscribers (perms has changed)
$globals->updateNbIns();
- if (!
start_connexion($uid, false
)) {
+ if (!
Platal::session()->startWeakSession($uid
)) {
return PL_FORBIDDEN;
}
return PL_FORBIDDEN;
}
- $_SESSION['auth'] = AUTH_MDP;
/***********************************************************/
/************* envoi d'un mail au démarcheur ***************/
/***********************************************************/
/************* envoi d'un mail au démarcheur ***************/
@@
-395,14
+397,14
@@
class RegisterModule extends PLModule
. " - forlife : $forlife\n"
. " - email : $email\n"
. " - sexe : $femme\n"
. " - 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 {
. "\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();
}
$mymail->setTxtBody($msg);
$mymail->send();
@@
-418,6
+420,7
@@
class RegisterModule extends PLModule
{
global $globals;
$page->changeTpl('register/success.tpl');
{
global $globals;
$page->changeTpl('register/success.tpl');
+ $page->assign('user', S::user());
$_SESSION['sub_state'] = array('step' => 5);
if (Env::has('response2')) {
$_SESSION['sub_state'] = array('step' => 5);
if (Env::has('response2')) {
@@
-428,23
+431,18
@@
class RegisterModule extends PLModule
S::v('uid'));
// If GoogleApps is enabled, and the user did choose to use synchronized passwords,
S::v('uid'));
// If GoogleApps is enabled, and the user did choose to use synchronized passwords,
- // and if the (stupid) user has decided to use
r
/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';
// 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);
}
}
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);
}
$page->assign('mdpok', true);
}
@@
-512,7
+510,8
@@
class RegisterModule extends PLModule
}
if (Post::v('imap')) {
require_once 'emails.inc.php';
}
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();
}
$storage->activate();
}