- #1474: Provides accounts data for accounts without profile -JAC
- #1476: Logs last use of Auth-Groupe-X keys -JAC
+ * Core:
+ - #1484: Fix reference to is_IE that does not exist anymore -FRU
+
* Emails:
- #1110: Improves email combobox -JAC
- #1459: Lists and administrates aliases on main domain -JAC
- #1477: Fixes display and (de)activation of email storages -JAC
+ - #1479: Fixes display of corps in bounce list -JAC
* Events:
- #1475: Fixes date storage for next reminder -JAC
foreach ($users as $user) {
$mailer->setTo($user['email']);
$mailer->assign('hash', $user['hash']);
- $mailer->assign('hruid', $user['hruid']);
+ $mailer->assign('email', $user['email']);
$mailer->assign('group', $user['group_name']);
$mailer->assign('sender_name', $user['sender_name']);
$mailer->send();
}
if (!S::logged() && Post::has('auth_type') && Post::v('auth_type') == 'xnet' && !Post::has('wait')) {
+ $email = Post::v('username');
$type = XDB::fetchOneCell('SELECT type
FROM accounts
- WHERE hruid = {?}',
- Post::v('username'));
- if (!is_null($type) && $type != 'xnet') {
+ WHERE email = {?}',
+ $email);
+ if ((!is_null($type) && $type != 'xnet') || !User::isForeignEmailAddress($email)) {
Platal::page()->trigErrorRedirect('Ce formulaire d\'authentification est réservé aux extérieurs à la communauté polytechnicienne.', '');
}
} else if (Post::s('domain') == 'hruid') {
$login = $uname;
$loginType = 'hruid';
+ } else if ((Post::s('domain') == 'email')) {
+ $login = XDB::fetchOneCell('SELECT SQL_CALC_FOUND_ROWS uid
+ FROM accounts
+ WHERE email = {?}',
+ $uname);
+ if (!(XDB::fetchOneCell('SELECT FOUND_ROWS()') == 1)) {
+ $login =null;
+ }
+ $loginType = 'uid';
} else {
$login = $uname;
$loginType = is_numeric($uname) ? 'uid' : 'alias';
-Subproject commit 852e6400e7b7dbc0c0d4c8b4e72ca009954056cb
+Subproject commit f759f3804cfa1cba90b17baf9b6bd1f9617e0315
}
if ((!href.contains(fqdn) && !this.className.contains('popup')) || node.hasClass('popup')) {
node.click(function () {
- window.open(href);
+ window.open(this.href);
return false;
});
}
}
switch (Env::v('action')) {
case 'retirer':
- if (($contact = User::get(Env::v('user')))) {
+ if (($contact = Profile::get(Env::v('user')))) {
if (XDB::execute("DELETE FROM contacts
WHERE uid = {?} AND contact = {?}",
$uid, $contact->id())) {
break;
case 'ajouter':
- if (($contact = User::get(Env::v('user')))) {
+ if (($contact = Profile::get(Env::v('user')))) {
XDB::execute('INSERT IGNORE INTO contacts (uid, contact)
VALUES ({?}, {?})',
$uid, $contact->id());
WHERE uid = {?} AND email = {?}", $user->id(), $email);
XDB::execute('UPDATE accounts AS a
INNER JOIN email_virtual_domains AS d ON (d.name = {?})
+ INNER JOIN email_virtual_domains AS m ON (d.aliasing = m.id)
SET a.best_domain = d.id
- WHERE a.uid = {?}',
- $domain, $user->id());
+ WHERE a.uid = {?} AND m.name = {?}',
+ $domain, $user->id(), $user->mainEmailDomain());
// As having a non-null bestalias value is critical in
// plat/al's code, we do an a posteriori check on the
FROM groups AS a
INNER JOIN group_members AS m ON (m.asso_id = a.id)
WHERE m.uid = {?} AND (a.cat = 'GroupesX' OR a.cat = 'Institutions')",
- $this->pid()));
+ $this->owner->id()));
$page->assign('listgroups', XDB::iterator("SELECT a.nom, a.diminutif, a.sub_url,
IF (a.cat = 'Institutions', a.cat, d.nom) AS dom
FROM groups AS a
$user = User::getSilentWithUID($uid);
$redirect = new Redirect($user);
$redirect->add_email($email);
+ fix_bestalias($user);
// Try to start a session (so the user don't have to log in); we will use
// the password available in Post:: to authenticate the user.
Platal::session()->startAvailableAuth();
$page->changeTpl('xnet/register.success.tpl');
- $page->assign('hruid', $res['hruid']);
+ $page->assign('email', $res['email']);
} else {
$page->changeTpl('platal/password.tpl');
$page->assign('xnet', true);
$page->trigErrorRedirect("Cette adresse n'existe pas ou n'existe plus sur le serveur.", '');
}
- $hruid = XDB::fetchOneCell('SELECT hruid
+ $email = XDB::fetchOneCell('SELECT email
FROM accounts
WHERE uid = {?}',
$uid);
Platal::session()->startAvailableAuth();
$page->changeTpl('xnet/register.success.tpl');
- $page->assign('hruid', $hruid);
+ $page->assign('email', $email);
} else {
$page->changeTpl('platal/password.tpl');
$page->assign('xnet_reset', true);
- $page->assign('hruid', $hruid);
+ $page->assign('email', $email);
$page->assign('do_auth', 1);
}
}
</div>
{/if}
- {if hasPerm('admin') || $smarty.session.user->canEdit($profile)}
+ {if hasPerm('admin') || ($smarty.session.user->canEdit($profile) && !$smarty.session.user->isMe($user))}
<div>
[{if hasPerm('admin') && $hasowner}{if !$registered && !$dead}
<a href="marketing/private/{$user->login()}">{*
*}{icon name=wrench title="administrer user"}</a>{/if}{*
*}{if hasPerm('admin') || $smarty.session.user->canEdit($profile)}{*
*}<a href="profile/edit/{$user->login()}">{*
- *}{icon name=user_edit title="modifier la fiche"}</a>{*
+ *}{icon name=user_edit title="modifier la fiche"}</a>{/if}{*
+ *}{if hasPerm('admin,edit_directory')}{*
*}<a href="profile/ax/{$user->login()}">{*
*}{icon name=user_gray title="fiche AX"}</a>{/if}]
</div>
</tr>
<tr>
<td>
- <input type="hidden" name="username" value="{$hruid}" />
+ <input type="hidden" name="username" value="{$email}" />
<input type="hidden" name="password" value="" />
- <input type="hidden" name="domain" value="hruid" />
+ <input type="hidden" name="domain" value="email" />
</td>
<td {popup caption='Connexion permanente' width='300' text='Décocher cette case pour que le site oublie ce navigateur.<br />
Il est conseillé de décocher la case si cette machine n\'est pas <b>strictement</b> personnelle'} colspan="2">
Après activation, vos paramètres de connexion seront :
-identifiant : {$hruid}
+identifiant : {$email}
mot de passe : celui que vous choisirez
Vous pouvez, dès à présent et pendant une période d'un mois, activer votre compte en cliquant sur le lien suivant :
<form action="{$smarty.server.REQUEST_URI}" method="post" id="login" onsubmit='doChallengeResponse(); return false;'>
<table class="bicol">
<tr>
- <td class="titre">Identifiant :</td>
+ <td class="titre">Identifiant (adresse email) :</td>
<td>
<input type="text" name="username" />
- <input type="hidden" name="domain" value="hruid" />
+ <input type="hidden" name="domain" value="email" />
</td>
</tr>
<tr>
</tr>
<tr>
<td class="titre">
- Identifiant :
+ Identifiant (adresse email) :
</td>
<td>
<input type="text" size="20" maxlength="255" name="login" />
profiter dès à présent des multiples fonctionnalités de Polytechnique.net.
</p>
<p>
- Pour rappel, votre identifiant est : <strong>{$hruid}</strong>
+ Pour rappel, votre identifiant est : <strong>{$email}</strong>
</p>
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
--- /dev/null
+ALTER TABLE contacts DROP FOREIGN KEY contacts_ibfk_2;
+DELETE FROM contacts
+ WHERE NOT EXISTS (SELECT profiles.*
+ FROM profiles
+ WHERE profiles.pid = contacts.contact);
+ALTER TABLE contacts ADD FOREIGN KEY (contact) REFERENCES profiles (pid) ON DELETE CASCADE ON UPDATE CASCADE;
+
+-- vim:set syntax=mysql: