JQUERY_PLUGINS=color
JQUERY_PLUGINS_PATHES=$(addprefix htdocs/javascript/jquery.,$(addsuffix .js,$(JQUERY_PLUGINS)))
- jquery: htdocs/javascript/jquery.js htdocs/javascript/jquery.autocomplete.js $(JQUERY_PLUGINS_PATHES) $(JQUERY_UI_PATHES)
+JQUERY_UI=core tabs
+JQUERY_UI_PATHES=$(addprefix htdocs/javascript/ui.,$(addsuffix .js,$(JQUERY_UI)))
+
-jquery: htdocs/javascript/jquery.js $(JQUERY_PLUGINS_PATHES)
+ # TODO: jquery.autocomplete.js should rather be downloaded from an official source. The issue
+ # is that the version we use is not available anymore on the Internet, and the latest version
+ # we could use is not backward compatible with our current code.
++jquery: htdocs/javascript/jquery.js $(JQUERY_PLUGINS_PATHES) $(JQUERY_UI_PATHES)
htdocs/javascript/jquery.js: DOWNLOAD_SRC = http://jquery.com/src/jquery-latest.min.js
htdocs/javascript/jquery.js:
# jQuery and its plugins are downloaded by the Makefile
/jquery.*js
+/ui.*js
+ !/jquery.autocomplete.js
}
}
}
- $email = $line[$field];
- if (strpos($email, '@') === false) {
- $user = $email;
- $domain = $globals->mail->domain2;
- } else {
- list($user, $domain) = explode('@', $email);
- }
- if ($domain != $globals->mail->domain && $domain != $globals->mail->domain2
- && $domain != $globals->mail->alias_dom && $domain != $globals->mail->alias_dom2) {
- $res = XDB::query("SELECT uid FROM emails WHERE email = {?}", $email);
- if ($res->numRows() == 1) {
- return $res->fetchOneCell();
- }
- return '0';
- }
- list($user) = explode('+', $user);
- list($user) = explode('_', $user);
- if ($domain == $globals->mail->alias_dom || $domain == $globals->mail->alias_dom2) {
- $res = XDB::query("SELECT a.id
- FROM virtual AS v
- INNER JOIN virtual_redirect AS r USING(vid)
- INNER JOIN aliases AS a ON (a.type = 'a_vie'
- AND r.redirect = CONCAT(a.alias, '@{$globals->mail->domain2}'))
- WHERE v.alias = CONCAT({?}, '@{$globals->mail->alias_dom}')", $user);
- $id = $res->fetchOneCell();
- return $id ? $id : '0';
- }
- $res = XDB::query("SELECT id FROM aliases WHERE alias = {?}", $user);
- $id = $res->fetchOneCell();
- return $id ? $id : '0';
+ $uf = new UserFilter(new UFC_Email($line[$field]));
+ $id = $uf->getUIDs();
+ return count($id) == 1 ? $id[0] : 0;
}
- function createHash($line, $key)
+ function createHash($line, $partial_result, $key)
{
$hash = implode(time(), $line) . rand();
$hash = md5($hash);
$account = new GoogleAppsAccount($user);
$storage = new EmailStorage($user, 'googleapps');
- // Force synchronization of plat/al and Google Apps passwords.
- if ($action == 'forcesync' && $account->sync_password) {
+ // Apply requested actions.
+ if (Post::has('suspend') && $account->active() && !$account->pending_update_suspension) {
+ S::assert_xsrf_token();
+ $account->suspend();
+ $page->trigSuccess('Le compte est en cours de suspension.');
+ } else if (Post::has('unsuspend') && $account->suspended() && !$account->pending_update_suspension) {
+ S::assert_xsrf_token();
+ $account->do_unsuspend();
+ $page->trigSuccess('Le compte est en cours de réactivation.');
+ } else if (Post::has('forcesync') && $account->active() && $account->sync_password) {
- $res = XDB::query("SELECT password FROM auth_user_md5 WHERE user_id = {?}", $user->id());
- $account->set_password($res->fetchOneCell());
++ $account->set_password($user->password());
+ $page->trigSuccess('Le mot de passe est en cours de synchronisation.');
+ } else if (Post::has('sync') && $account->active()) {
- $res = XDB::query("SELECT password FROM auth_user_md5 WHERE user_id = {?}", $user->id());
- $account->set_password($res->fetchOneCell());
+ $account->set_password($user->password());
- $page->trigSuccess('Le mot de passe a été synchronisé.');
+ $account->set_password_sync(true);
+ } else if (Post::has('nosync') && $account->active()) {
+ $account->set_password_sync(false);
}
// Displays basic account information.