CONCAT(af.alias, '@{$globals->mail->domain}') AS forlife,
CONCAT(ab.alias, '@{$globals->mail->domain}') AS bestalias,
a.full_name, a.display_name, a.sex = 'female' AS gender,
- a.email_format, a.password,
- IF (a.state = 'active', at.perms, '') AS perms,
- a.is_admin
+ IF(a.state = 'active', at.perms, '') AS perms,
+ a.email_format, a.is_admin
FROM accounts AS a
INNER JOIN account_types AS at ON (at.type = a.type)
INNER JOIN profile_display AS d ON (d.uid = a.uid)
$this->perm_flags = self::makePerms($this->perms, $this->is_admin);
}
+ // We do not want to store the password in the object.
+ // So, fetch it 'on demand'
+ public function password()
+ {
+ return XDB::fetchOneCell('SELECT a.password
+ FROM accounts AS a
+ WHERE a.uid = {?}', $this->id());
+ }
+
/** Return the main profile attached with this account if any.
*/
public function profile()
-Subproject commit 933e1c23f280a829faf7c112164341f47957c0fb
+Subproject commit 35fff9b04585817e74f4709f36b70d959ce3224c
return 1;
}
- $list = new MMList(S::user()->id(), S::v('password'), $this->domain);
+ $list = new MMList(S::user()->id(), $this->domain);
$ret = $list->create_list($this->liste, utf8_decode($this->desc), $this->advertise,
$this->modlevel, $this->inslevel,
$this->owners, $this->members);
$cle = $globals->core->econfiance;
if (S::v('chall') && $_GET['PASS'] == md5(S::v('chall').$cle)) {
-
- $res = XDB::query("SELECT password FROM auth_user_md5 WHERE user_id=10154");
- $pass = $res->fetchOneCell();
-
- $list = new MMList(10154, $pass, "x-econfiance.polytechnique.org");
+ $list = new MMList(User::getWithUID(10154), "x-econfiance.polytechnique.org");
$members = $list->get_members('membres');
if (is_array($members)) {
$membres = Array();
$user = S::user();
}
- $this->client = new MMList($user->id(), $user->password);
+ $this->client = new MMList($user);
return $globals->mail->domain;
}
}
}
- function handler_admin_all(&$page) {
+ function handler_admin_all(&$page)
+ {
$page->changeTpl('lists/admin_all.tpl');
$page->setTitle('Administration - Mailing lists');
- $client = new MMList(S::v('uid'), S::v('password'));
- $listes = $client->get_all_lists();
+ $this->prepare_client($page);
+ $listes = $this->client->get_all_lists();
$page->assign_by_ref('listes', $listes);
}
}
);
}
- function prepare_client(&$page)
+ function prepare_client(&$page, $user = null)
{
global $globals;
Platal::load('lists', 'lists.inc.php');
- $this->client = new MMList(S::v('uid'), S::v('password'),
- $globals->asso('mail_domain'));
+ if (is_null($user)) {
+ $user =& S::user();
+ }
+ $this->client = new MMList($user, $globals->asso('mail_domain'));
$page->assign('asso', $globals->asso());
$page->setType($globals->asso('cat'));