================================================================================
+VERSION 1.0.1 XX XX XXXX
+
+From 1.0.0 branch:
+ * AXLetter:
+ - Fix unsubscription -XEL
+
+ * Carnet:
+ - Fix inaccessible carnet/panel in case of profile update -FRU
+ - Fix notification email -JAC
+
+ * Events:
+ - Fix promotion_ml reminder -FRU
+
+ * Lists:
+ - Fix inclusion of banana for achives and moderation preview -FRU
+
+ * Profile:
+ - Fix entreprise validation -JAC
+ - Fix name validation -XEL
+ - Fix orange validation -XEL
+ - Fix vcards -FRU
+ - Fix geocoding -JAC
+
+ * Newsletter:
+ - Fix user selection -FRU
+
+ * Register:
+ - Fix calls to missing functions -JAC
+
+ * Search:
+ - Fix filtering by promotion -XEL
+ - Fix search by address -XEL
+
+ * XnetGrp:
+ - Fix name in unsubscription notification -JAC
+ - Fix mailer sending O(n^2) mails -VZA
+
+ * XnetList:
+ - Fix group directory synchronization page -JAC
+
+================================================================================
VERSION 1.0.0 30 06 2010
New:
## conf
##
-conf: spool/templates_c spool/mails_c classes/platalglobals.php configs/platal.cron htdocs/.htaccess spool/conf spool/tmp
+conf: spool/templates_c spool/mails_c classes/platalglobals.php configs/platal.cron htdocs/.htaccess spool/conf spool/tmp
spool/templates_c spool/mails_c spool/uploads spool/conf spool/tmp spool/run:
mkdir -p $@
--- /dev/null
+#!/usr/bin/php5 -q
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2010 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+
+require_once 'connect.db.inc.php';
+require_once 'plmailer.php';
+global $globals;
+
+$res = XDB::iterator('SELECT p.hrpid, pm.pid, a.full_name, pm.field, pm.oldText, pm.newText, p.sex, pd.yourself, al.alias
+ FROM profile_modifications AS pm
+ INNER JOIN accounts AS a ON (pm.uid = a.uid)
+ INNER JOIN profiles AS p ON (pm.pid = p.pid)
+ INNER JOIN profile_display AS pd ON (pm.pid = pd.pid)
+ INNER JOIN account_profiles AS ap ON (pm.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
+ INNER JOIN aliases AS al ON (ap.uid = al.uid AND FIND_IN_SET(\'bestalias\', al.flags))
+ ORDER BY pm.pid, pm.field');
+
+$date = time();
+$values = $res->next();
+
+$pid = $values['pid'];
+$sex = ($values['sex'] == 'female') ? 1 : 0;
+$yourself = $values['yourself'];
+$alias = $values['alias'];
+$hrpid = $values['hrpid'];
+$modifications = array();
+$modifications[] = array(
+ 'full_name' => $values['full_name'],
+ 'field' => $values['field'],
+ 'oldText' => $values['oldText'],
+ 'newText' => $values['newText'],
+);
+
+while ($values = $res->next()) {
+ if ($values['pid'] != $pid) {
+ $mailer = new PlMailer('profile/notification.mail.tpl');
+ $mailer->addTo($alias . '@' . $globals->mail->domain);
+ $mailer->assign('modifications', $modifications);
+ $mailer->assign('yourself', $yourself);
+ $mailer->assign('hrpid', $hrpid);
+ $mailer->assign('sex', $sex);
+ $mailer->assign('date', $date);
+ $mailer->send();
+ $modifications = array();
+ }
+ $pid = $values['pid'];
+ $sex = ($values['sex'] == 'female') ? 1 : 0;
+ $yourself = $values['yourself'];
+ $alias = $values['alias'];
+ $hrpid = $values['hrpid'];
+ $modifications[] = array(
+ 'full_name' => $values['full_name'],
+ 'field' => $values['field'],
+ 'oldText' => $values['oldText'],
+ 'newText' => $values['newText'],
+ );
+}
+$mailer = new PlMailer('profile/notification.mail.tpl');
+$mailer->addTo($alias . '@' . $globals->mail->domain);
+$mailer->assign('modifications', $modifications);
+$mailer->assign('yourself', $yourself);
+$mailer->assign('hrpid', $hrpid);
+$mailer->assign('sex', $sex);
+$mailer->assign('date', $date);
+$mailer->send();
+
+XDB::execute('DELETE FROM profile_modifications');
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
require_once 'marketing.inc.php';
$opts = getopt('f:l:m:');
-if (($opts['f'] && $opts['f'] == '-') || empty($opts['f'])) {
- $file = 'php://stdin';
+if (($opts['f'] && $opts['f'] == '-') || empty($opts['f'])) {
+ $file = 'php://stdin';
} else {
$file = $opts['f'];
}
const EDUDEGREES = 'educationdegrees';
const EDUFIELDS = 'educationfields';
+ const CORPS = 'corps';
+ const CORPSRANKS = 'corpsranks';
+
const NATIONALITIES = 'nationalities';
const COUNTRIES = 'countries';
const ADMINAREAS = 'adminareas';
const NETWORKS = 'networking';
+ const MEDALS = 'medals';
+
static private $enumerations = array();
static private function init($type)
}
// }}}
+ /** Builds a list of query parts for searching @$text in @$field :
+ * field LIKE 'text%', field LIKE '% text%', field LIKE '%-text%'
+ */
private function mkTests($field, $text)
{
$tests = array();
}
// }}}
+// {{{ class DE_Corps
+class DE_Corps extends DirEnumeration
+{
+ protected $idfield = 'corps_enum.id';
+ protected $valfield = 'corps_enum.name';
+ protected $valfield2 = 'corps_enum.abbrev';
+ protected $from = 'corps_enum';
+
+ protected $ac_unique = 'corps.pid';
+ protected $ac_join = 'INNER JOIN corps ON (corps.current_corpsid = corps_enum.id)';
+}
+// }}}
+
+// {{{ class DE_CorpsRanks
+class DE_CorpsRanks extends DirEnumeration
+{
+ protected $idfield = 'corps_rank_enum.id';
+ protected $valfield = 'corps_rank_enum.name';
+ protected $valfield2 = 'corps_rank_enum.abbrev';
+ protected $from = 'corps_rank_enum';
+
+ protected $ac_unique = 'corps.pid';
+ protected $ac_join = 'INNER JOIN corps ON (corps.rankid = corps_rank_enum.id)';
+}
+// }}}
+
/** GEOLOC
*/
// {{{ class DE_Nationalities
}
// }}}
+/** MEDALS
+ */
+// {{{ class DE_Medals
+class DE_Medals extends DirEnumeration
+{
+ protected $from = 'profile_medal_enum';
+
+ protected $ac_join = 'INNER JOIN profile_medals ON (profile_medals.mid = profile_medal_enum.id)';
+ protected $ac_unique = 'profile_medals.pid';
+}
+// }}}
+
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>
return $this->owner;
}
+ public function isActive()
+ {
+ if ($this->owner()) {
+ return $this->owner->isActive();
+ }
+ return false;
+ }
+
public function promo()
{
return $this->promo;
public function nationalities()
{
$nats = array();
+ $countries = DirEnum::getOptions(DirEnum::COUNTRIES);
if ($this->nationality1) {
- $nats[] = $this->nationality1;
+ $nats[$this->nationality1] = $countries[$this->nationality1];
}
if ($this->nationality2) {
- $nats[] = $this->nationality2;
+ $nats[$this->nationality2] = $countries[$this->nationality2];
}
if ($this->nationality3) {
- $nats[] = $this->nationality3;
+ $nats[$this->nationality3] = $countries[$this->nationality3];
}
return $nats;
}
$it = XDB::Iterator('SELECT p.pid, p.hrpid, p.xorg_id, p.ax_id, p.birthdate, p.birthdate_ref,
p.next_birthday, p.deathdate, p.deathdate_rec, p.sex = \'female\' AS sex,
- p.cv, p.medals_pub, p.alias_pub, p.email_directory, p.last_change,
- p.nationality1, p.nationality2, p.nationality3,
+ IF ({?}, p.cv, NULL) AS cv, p.medals_pub, p.alias_pub, p.email_directory,
+ p.last_change, p.nationality1, p.nationality2, p.nationality3,
IF (p.freetext_pub IN {?}, p.freetext, NULL) AS freetext,
pe.entry_year, pe.grad_year,
IF ({?}, pse.text, NULL) AS section,
IF( {?}, pn_n.name, NULL) AS nickname,
IF(pn_uf.name IS NULL, pn_f.name, pn_uf.name) AS firstname_ordinary,
IF(pn_ul.name IS NULL, pn_l.name, pn_ul.name) AS lastname_ordinary,
- pd.yourself, pd.promo, pd.short_name, pd.directory_name AS full_name,
- pd.directory_name, IF(pp.pub IN {?}, pp.display_tel, NULL) AS mobile,
+ pd.yourself, pd.promo, pd.short_name, pd.public_name AS full_name,
+ pd.directory_name, pd.public_name, pd.private_name,
+ IF(pp.pub IN {?}, pp.display_tel, NULL) AS mobile,
(ph.pub IN {?} AND ph.attach IS NOT NULL) AS has_photo,
ph.x AS photo_width, ph.y AS photo_height,
p.last_change < DATE_SUB(NOW(), INTERVAL 365 DAY) AS is_old,
WHERE p.pid IN {?}
GROUP BY p.pid
' . $order,
- $visibility->levels(),
- $visibility->isVisible(ProfileVisibility::VIS_PRIVATE),
- $visibility->isVisible(ProfileVisibility::VIS_PRIVATE),
- $visibility->levels(),
- $visibility->levels(),
+ $visibility->isVisible(ProfileVisibility::VIS_PRIVATE), // CV
+ $visibility->levels(), // freetext
+ $visibility->isVisible(ProfileVisibility::VIS_PRIVATE), // section
+ $visibility->isVisible(ProfileVisibility::VIS_PRIVATE), // nickname
+ $visibility->levels(), // mobile
+ $visibility->levels(), // photo
$pids
);
return new ProfileIterator($it, $pids, $fields, $visibility);
|| $name == self::DN_SHORT || $name == self::DN_SORT;
}
+ /** Returns the closest "accounts only" name type for $name
+ */
+ public static function getAccountEquivalentName($name)
+ {
+ switch ($name)
+ {
+ case self::DN_DIRECTORY:
+ case self::DN_SORT:
+ return 'directory_name';
+ case self::DN_FULL:
+ case self::DN_PUBLIC:
+ return 'full_name';
+ case self::DN_PRIVATE:
+ case self::DN_SHORT:
+ case self::DN_YOURSELF:
+ default:
+ return 'display_name';
+ }
+ }
+
public static function getNameTypeId($type, $for_sql = false)
{
if (!S::has('name_types')) {
/** The school identifier consists of 6 digits. The first 3 represent the
* promotion entry year. The last 3 indicate the student's rank.
- *
+ *
* Our identifier consists of 8 digits and both half have the same role.
* This enables us to deal with bigger promotions and with a wider range
* of promotions.
return $res->fetchOneCell();
}
- /** TODO: implements this by inspecting the profile.
if (preg_match('/^(.*)\.([0-9]{4})$/u', $mbox, $matches)) {
$res = XDB::query('SELECT a.uid
- FROM accounts AS a
- INNER JOIN aliases AS al ON (al.id = a.uid AND al.type IN ('alias', 'a_vie'))
- WHERE al.alias = {?} AND a.promo = {?}', $matches[1], $matches[2]);
+ FROM accounts AS a
+ INNER JOIN aliases AS al ON (al.uid = a.uid AND al.type IN (\'alias\', \'a_vie\'))
+ INNER JOIN account_profiles AS ap ON (a.uid = ap.uid AND FIND_IN_SET(\'owner\', ap.perms))
+ INNER JOIN profiles AS p ON (p.pid = ap.pid)
+ INNER JOIN profile_education AS pe ON (p.pid = pe.pid AND FIND_IN_SET(\'primary\', pe.flags))
+ WHERE p.hrpid = {?} OR ((pe.entry_year <= {?} AND pe.grad_year >= {?}) AND al.alias = {?})
+ GROUP BY a.uid',
+ $matches[0], $matches[2], $matches[2], $matches[1]);
if ($res->numRows() == 1) {
return $res->fetchOneCell();
}
- }*/
+ }
throw new UserNotFoundException();
}
$uids = array_map(array('XDB', 'escape'), $uids);
return XDB::iterator('SELECT a.uid, a.hruid, a.registration_date, ah.alias AS homonym,
- IF (af.alias IS NULL, a.email, CONCAT(af.alias, \'@' . $globals->mail->domain . '\')) AS forlife,
- CONCAT(af.alias, \'@' . $globals->mail->domain2 . '\') AS forlife_alternate,
- IF (ab.alias IS NULL, a.email, CONCAT(ab.alias, \'@' . $globals->mail->domain . '\')) AS bestalias,
- CONCAT(ab.alias, \'@' . $globals->mail->domain2 . '\') AS bestalias_alternate,
- a.full_name, a.display_name, a.sex = \'female\' AS gender,
+ IF (af.alias IS NULL, NULL, CONCAT(af.alias, \'@' . $globals->mail->domain . '\')) AS forlife,
+ IF (af.alias IS NULL, NULL, CONCAT(af.alias, \'@' . $globals->mail->domain2 . '\')) AS forlife_alternate,
+ IF (ab.alias IS NULL, NULL, CONCAT(ab.alias, \'@' . $globals->mail->domain . '\')) AS bestalias,
+ IF (ab.alias IS NULL, NULL, CONCAT(ab.alias, \'@' . $globals->mail->domain2 . '\')) AS bestalias_alternate,
+ a.email, a.full_name, a.directory_name, a.display_name, a.sex = \'female\' AS gender,
IF(a.state = \'active\', at.perms, \'\') AS perms,
a.email_format, a.is_admin, a.state, a.type, a.skin,
FIND_IN_SET(\'watch\', a.flags) AS watch, a.comment,
- a.weak_password IS NOT NULL AS weak_access,
- a.token IS NOT NULL AS token_access,
- (e.email IS NULL AND NOT FIND_IN_SET(\'googleapps\', eo.storage)) AND a.state != \'pending\' AS lost
+ a.weak_password IS NOT NULL AS weak_access, g.g_account_name IS NOT NULL AS googleapps,
+ a.token IS NOT NULL AS token_access, a.token, a.last_version,
+ (e.email IS NULL AND NOT FIND_IN_SET(\'googleapps\', eo.storage)) AND a.state != \'pending\' AS lost,
+ UNIX_TIMESTAMP(s.start) AS lastlogin, s.host, UNIX_TIMESTAMP(fp.last_seen) AS banana_last
' . $fields . '
FROM accounts AS a
INNER JOIN account_types AS at ON (at.type = a.type)
LEFT JOIN aliases AS ah ON (ah.uid = a.uid AND ah.type = \'homonyme\')
LEFT JOIN emails AS e ON (e.uid = a.uid AND e.flags = \'active\')
LEFT JOIN email_options AS eo ON (eo.uid = a.uid)
+ LEFT JOIN gapps_accounts AS g ON (a.uid = g.l_userid AND g.g_status = \'active\')
+ LEFT JOIN log_last_sessions AS ls ON (ls.uid = a.uid)
+ LEFT JOIN log_sessions AS s ON (s.id = ls.id)
+ LEFT JOIN forum_profiles AS fp ON (fp.uid = a.uid)
' . $joins . '
WHERE a.uid IN (' . implode(', ', $uids) . ')
GROUP BY a.uid
$this->fillFromArray(self::loadMainFieldsFromUIDs(array($this->uid))->next());
}
- // Specialization of the fillFromArray method, to implement hacks to enable
- // lazy loading of user's main properties from the session.
- // TODO(vzanotti): remove the conversion hacks once the old codebase will
- // stop being used actively.
- protected function fillFromArray(array $values)
- {
- // Also, if display_name and full_name are not known, but the user's
- // surname and last name are, we can construct the former two.
- if (isset($values['prenom']) && isset($values['nom'])) {
- if (!isset($values['display_name'])) {
- $values['display_name'] = ($values['prenom'] ? $values['prenom'] : $values['nom']);
- }
- if (!isset($values['full_name'])) {
- $values['full_name'] = $values['prenom'] . ' ' . $values['nom'];
- }
- }
-
- // We also need to convert the gender (usually named "femme"), and the
- // email format parameter (valued "texte" instead of "text").
- if (isset($values['femme'])) {
- $values['gender'] = (bool) $values['femme'];
- }
- if (isset($values['mail_fmt'])) {
- $values['email_format'] = $values['mail_fmt'];
- }
-
- parent::fillFromArray($values);
- }
-
// Specialization of the buildPerms method
// This function build 'generic' permissions for the user. It does not take
// into account page specific permissions (e.g X.net group permissions)
WHERE a.uid = {?}', $this->id());
}
+ public function isActive()
+ {
+ return $this->state == 'active';
+ }
+
/** Overload PlUser::promo(): there no promo defined for a user in the current
* schema. The promo is a field from the profile.
*/
return $this->profile()->lastName();
}
+ public function displayName()
+ {
+ if (!$this->hasProfile()) {
+ return $this->display_name;
+ }
+ return $this->profile()->yourself;
+ }
+
+ public function fullName($with_promo = false)
+ {
+ if (!$this->hasProfile()) {
+ return $this->full_name;
+ }
+ return $this->profile()->fullName($with_promo);
+ }
+
+ public function directoryName()
+ {
+ if (!$this->hasProfile()) {
+ return $this->directory_name;
+ }
+ return $this->profile()->directory_name;
+ }
+
/** Return the main profile attached with this account if any.
*/
- public function profile()
+ public function profile($forceFetch = false)
{
- if (!$this->_profile_fetched) {
+ if (!$this->_profile_fetched || $forceFetch) {
$this->_profile_fetched = true;
$this->_profile = Profile::get($this);
}
*/
private function fetchMarketingData()
{
- if (isset($this->last_known_email)) {
+ if (isset($this->pending_registration_date)) {
return;
}
- // FIXME: We should fetch the last known email as well as the pending registration email (they aren't the same !)
- $infos = XDB::fetchOneAssoc('SELECT IF (MAX(m.last) > p.relance, MAX(m.last), p.relance) AS last_relance,
- p.email AS last_known_email
- FROM register_pending AS p
- LEFT JOIN register_marketing AS m ON (p.uid = m.uid)
- WHERE p.uid = {?}
- GROUP BY p.uid', $this->id());
- if (!$infos) {
- $infos = array('last_relance' => null, 'last_known_email' => null);
+ $infos = XDB::fetchOneAssoc('SELECT rp.date AS pending_registration_date, rp.email AS pending_registration_email,
+ rm.last AS last_marketing_date, rm.email AS last_marketing_email
+ FROM accounts AS a
+ LEFT JOIN register_pending AS rp ON (rp.uid = a.uid)
+ LEFT JOIN register_marketing AS rm ON (rm.uid = a.uid AND rm.last != \'0000-00-00\')
+ WHERE a.uid = {?}
+ ORDER BY rm.last DESC', $this->id());
+ if (is_null($infos)) {
+ $infos = array(
+ 'pending_registration_date' => null,
+ 'pending_registration_email' => null,
+ 'last_marketing_date' => null,
+ 'last_marketing_email' => null
+ );
}
$this->fillFromArray($infos);
}
- public function lastMarketingRelance()
+ public function pendingRegistrationDate()
+ {
+ $this->fetchMarketingData();
+ return $this->pending_registration_date;
+ }
+
+ public function pendingRegistrationEmail()
{
$this->fetchMarketingData();
- return $this->last_relance;
+ return $this->pending_registration_email;
+ }
+
+ public function lastMarketingDate()
+ {
+ $this->fetchMarketingData();
+ return $this->last_marketing_date;
+ }
+
+ public function lastMarketingEmail()
+ {
+ $this->fetchMarketingData();
+ return $this->last_marketing_email;
}
public function lastKnownEmail()
{
$this->fetchMarketingData();
- return $this->last_known_email;
+ if ($this->pending_registration_email > $this->last_marketing_date) {
+ return $this->pending_registration_email;
+ }
+ return $this->last_marketing_email;
}
$this->email_format = $format;
}
-
/** Get watch informations
*/
private function fetchWatchData()
}
$mmlist = new MMList($this);
- $mmlist->kill($alias, $clearAll);
+ $mmlist->kill($this->hruid, $clearAll);
}
// Merge all infos in other user and then clean this one
public function mergeIn(User &$newuser) {
- if ($this->profile() || !$newuser->id()) {
- // don't disable user with profile in this way
+ if ($this->profile()) {
+ // Don't disable user with profile in this way.
+ global $globals;
+ Platal::page()->trigError('Impossible de fusionner les comptes ' . $this->hruid . ' et ' . $newuser->hruid .
+ '. Contacte support@' . $globals->mail->domain . '.');
return false;
}
- // TODO check all tables to see if there is no other info to use
- $newemail = $newuser->forlifeEmail();
- if (!$newemail && $this->forlifeEmail()) {
- XDB::execute("UPDATE accounts
- SET email = {?}
- WHERE uid = {?} AND email IS NULL",
- $this->forlifeEmail(), $newuser->id());
- $newemail = $this->forlifeEmail();
- }
-
- // change email used in aliases and mailing lists
- if ($this->forlifeEmail() != $newemail && $this->forlifeEmail()) {
- // virtual_redirect (email aliases)
- XDB::execute("DELETE v1
- FROM virtual_redirect AS v1, virtual_redirect AS v2
- WHERE v1.vid = v2.vid AND v1.redirect = {?} AND v2.redirect = {?}",
- $this->forlifeEmail(), $newemail);
- XDB::execute("UPDATE virtual_redirect
- SET redirect = {?}
- WHERE redirect = {?}",
- $newemail, $this->forlifeEmail());
-
- // require_once 'mmlist.php';
-
- // group mailing lists
- $group_domains = XDB::fetchColumn("SELECT g.mail_domain
- FROM groups AS g
- INNER JOIN group_members AS gm ON(g.id = gm.asso_id)
- WHERE g.mail_domain != '' AND gm.uid = {?}",
- $this->id());
- foreach ($group_domains as $mail_domain) {
- $mmlist = new MMList($this, $mail_domain);
- $mmlist->replace_email_in_all($this->forlifeEmail(), $newmail);
+ if ($this->forlifeEmail()) {
+ // If the new user is not registered and does not have already an email address,
+ // we need to give him the old user's email address if he has any.
+ if (!$newuser->perms) {
+ XDB::execute('UPDATE accounts
+ SET email = {?}
+ WHERE uid = {?} AND email IS NULL',
+ $this->forlifeEmail(), $newuser->id());
}
- // main domain lists
- $mmlist = new MMList($this);
- $mmlist->replace_email_in_all($this->forlifeEmail(), $newmail);
- }
-
- // group_members (xnet group membership)
- XDB::execute("DELETE g1
- FROM group_members AS g1, group_members AS g2
- WHERE g1.uid = {?} AND g2.uid = {?} AND g1.asso_id = g2.asso_id",
- $this->id(), $newuser->id());
- XDB::execute("UPDATE group_members
- SET uid = {?}
- WHERE uid = {?}",
- $this->id(), $newuser->id());
+ $newemail = XDB::fetchOneCell('SELECT email
+ FROM accounts
+ WHERE uid = {?}',
+ $newuser->id());
+
+ // Change email used in aliases and mailing lists.
+ if ($this->forlifeEmail() != $newemail) {
+ // virtual_redirect (email aliases)
+ XDB::execute('DELETE v1
+ FROM virtual_redirect AS v1, virtual_redirect AS v2
+ WHERE v1.vid = v2.vid AND v1.redirect = {?} AND v2.redirect = {?}',
+ $this->forlifeEmail(), $newemail);
+ XDB::execute('UPDATE virtual_redirect
+ SET redirect = {?}
+ WHERE redirect = {?}',
+ $newemail, $this->forlifeEmail());
+
+ // group mailing lists
+ $group_domains = XDB::fetchColumn('SELECT g.mail_domain
+ FROM groups AS g
+ INNER JOIN group_members AS gm ON(g.id = gm.asso_id)
+ WHERE g.mail_domain != \'\' AND gm.uid = {?}',
+ $this->id());
+ foreach ($group_domains as $mail_domain) {
+ $mmlist = new MMList($this, $mail_domain);
+ $mmlist->replace_email_in_all($this->forlifeEmail(), $newemail);
+ }
+ // main domain lists
+ $mmlist = new MMList($this);
+ $mmlist->replace_email_in_all($this->forlifeEmail(), $newemail);
+ }
+ }
+
+ // Updates user in following tables.
+ foreach (array('group_announces', 'payment_transactions', 'log_sessions') as $table) {
+ XDB::execute('UPDATE ' . $table . '
+ SET uid = {?}
+ WHERE uid = {?}',
+ $newuser->id(), $this->id());
+ }
+ XDB::execute('UPDATE group_events
+ SET organisateur_uid = {?}
+ WHERE organisateur_uid = {?}',
+ $newuser->id(), $this->id());
+
+ // Merges user in following tables, ie updates when possible, then deletes remaining occurences of the old user.
+ foreach (array('group_announces_read', 'group_event_participants', 'group_member_sub_requests', 'group_members') as $table) {
+ XDB::execute('UPDATE IGNORE ' . $table . '
+ SET uid = {?}
+ WHERE uid = {?}',
+ $newuser->id(), $this->id());
+ XDB::execute('DELETE FROM ' . $table . '
+ WHERE uid = {?}',
+ $this->id());
+ }
- XDB::execute("DELETE FROM accounts WHERE uid = {?}", $this->id());
+ // Eventually updates last session id and deletes old user's accounts entry.
+ $lastSession = XDB::fetchOneCell('SELECT id
+ FROM log_sessions
+ WHERE uid = {?}
+ ORDER BY start DESC
+ LIMIT 1',
+ $newuser->id());
+ XDB::execute('UPDATE log_last_sessions
+ SET id = {?}
+ WHERE uid = {?}',
+ $newuser->id());
+ XDB::execute('DELETE FROM accounts
+ WHERE uid = {?}',
+ $this->id());
return true;
}
public function buildCondition(PlFilter &$uf)
{
$sub = $uf->addJobCompanyFilter();
- $cond = $sub . '.' . $this->type . ' = ' . XDB::format('{?}', $this->value);
+ $cond = $sub . '.' . $this->type . XDB::formatWildcards(XDB::WILDCARD_CONTAINS, $this->value);
return $cond;
}
}
{
if (Profile::isDisplayName($this->type)) {
$sub = $uf->addDisplayFilter();
- return 'pd' . $sub . '.' . $this->type;
+ $token = 'pd' . $sub . '.' . $this->type;
+ if ($uf->accountsRequired()) {
+ $account_token = Profile::getAccountEquivalentName($this->type);
+ return 'IFNULL(' . $token . ', a.' . $account_token . ')';
+ } else {
+ return $token;
+ }
} else {
$sub = $uf->addNameFilter($this->type, $this->variant);
if ($this->particle) {
* when referring to the joined table.
*
* For example, if data from profile_job must be available to filter results,
- * the UFC object will call $uf-addJobFilter(), which will set the 'with_pj' var and
+ * the UFC object will call $uf-addJobFilter(), which will set the 'with_pj' var and
* return 'pj', the short name to use when referring to profile_job; when building
* the query, calling the jobJoins function will return an array containing a single
* row:
$this->with_accounts = true;
}
+ public function accountsRequired()
+ {
+ return $this->with_accounts;
+ }
+
public function requireProfiles()
{
$this->with_profiles = true;
}
+ public function profilesRequired()
+ {
+ return $this->with_profiles;
+ }
+
protected function accountJoins()
{
$joins = array();
if (!is_array($key)) {
$key = array($key);
}
- $joins['e' . $sub] = PlSqlJoin::left('emails', '$ME.uid = $UID AND $ME.flags != \'filter\'
+ $joins['e' . $sub] = PlSqlJoin::left('emails', '$ME.uid = $UID AND $ME.flags != \'filter\'
AND $ME.email IN {?}', $key);
}
}
if (!is_array($key)) {
$key = array($key);
}
- $joins['al' . $sub] = PlSqlJoin::left('aliases', '$ME.uid = $UID AND $ME.type IN (\'alias\', \'a_vie\')
+ $joins['al' . $sub] = PlSqlJoin::left('aliases', '$ME.uid = $UID AND $ME.type IN (\'alias\', \'a_vie\')
AND $ME.alias IN {?}', $key);
}
}
{
if (!$this->nomenu) {
$this->useMenu();
+ } else {
+ $this->assign('menu', false);
}
$this->_run('xnet/skin.tpl');
}
LIMIT 1", $user->id());
$sess = $res->fetchOneAssoc();
$_SESSION = array_merge($_SESSION, $sess);
- $this->makePerms(S::s('perms'), S::b('is_admin'));
+ $this->makePerms(S::s('perms'), S::user()->is_admin);
S::kill('challenge');
S::kill('loginX');
S::kill('may_update');
$login);
if (list($uid, $password) = $res->fetchOneRow()) {
$expected_response = sha1("$uname:$password:" . S::v('challenge'));
- /* XXX: Deprecates len(password) > 10 conversion */
+ /* Deprecates len(password) > 10 conversion. */
if ($response != $expected_response) {
if (!S::logged()) {
Platal::page()->trigError('Mot de passe ou nom d\'utilisateur invalide');
S::set('auth', AUTH_MDP);
}
- // Retrieves main user properties.
- /** TODO: Move needed informations to account tables */
- /** TODO: Currently suppressed data are matricule, promo */
- /** TODO: Use the User object to fetch all this */
- $res = XDB::query("SELECT a.uid, a.hruid, a.display_name, a.full_name,
- a.sex = 'female' AS femme, a.email_format,
- a.token, FIND_IN_SET('watch', a.flags) AS watch_account,
- UNIX_TIMESTAMP(fp.last_seen) AS banana_last,
- a.last_version, g.g_account_name IS NOT NULL AS googleapps,
- UNIX_TIMESTAMP(s.start) AS lastlogin, s.host,
- a.is_admin, at.perms
- FROM accounts AS a
- INNER JOIN account_types AS at ON (a.type = at.type)
- LEFT JOIN watch AS w ON (w.uid = a.uid)
- LEFT JOIN forum_profiles AS fp ON (fp.uid = a.uid)
- LEFT JOIN gapps_accounts AS g ON (a.uid = g.l_userid AND g.g_status = 'active')
- LEFT JOIN log_last_sessions AS ls ON (ls.uid = a.uid)
- LEFT JOIN log_sessions AS s ON(s.id = ls.id)
- WHERE a.uid = {?} AND a.state = 'active'", $user->id());
- if ($res->numRows() != 1) {
- return false;
- }
-
- $sess = $res->fetchOneAssoc();
- $perms = $sess['perms'];
- unset($sess['perms']);
-
- // Loads the data into the real session.
- $_SESSION = array_merge($_SESSION, $sess);
+ // Loads uid and hruid into the session for developement conveniance.
+ $_SESSION = array_merge($_SESSION, array('uid' => $user->id(), 'hruid' => $user->hruid));
// Starts the session's logger, and sets up the permanent cookie.
if (S::suid()) {
}
// Finalizes the session setup.
- $this->makePerms($perms, S::b('is_admin'));
+ $this->makePerms($user->perms, $user->is_admin);
$this->securityChecks();
$this->setSkin();
$this->updateNbNotifs();
from="Webmaster Polytechnique.org" <web@polytechnique.org>
to=registration+watch@staff.m4x.org
replyto=registration+watch@staff.m4x.org
+
+[profile]
+from="Polytechnique.org" <validation_modification@polytechnique.org>
+cc="Polytechnique.org" <validation_modification@polytechnique.org>
+
0 2 * * * web cd $WD; ./notifs.birthday.php
0 4 * * 6 web cd $WD; ./notifs.send.php
+# profile modification notifications
+0 23 * * * web cd $WD; ./profile_modification.php
+
# validations
0 */3 * * * web cd $WD; ./cron_validations.php
-Subproject commit 786bffb570bfc2f5ff1dad386a9558501d4c16e8
+Subproject commit ef138fdcc27646d255cb98615c3e64724496c9bd
function doChallengeResponse() {
var new_pass = hash_encrypt(document.forms.login.password.value);
-
+
str = document.forms.loginsub.username.value + ":" +
hash_encrypt(document.forms.login.password.value) + ":" +
document.forms.loginsub.challenge.value;
function() {
$(this).removeClass("ac_over");
}
- ).click(function(e) {
+ ).click(function(e) {
e.preventDefault();
e.stopPropagation();
selectItem(this)
};
function makeUrl(q) {
- var sep = options.url.indexOf('?') == -1 ? '?' : '&';
+ var sep = options.url.indexOf('?') == -1 ? '?' : '&';
var url = options.url + sep + "q=" + encodeURI(q);
for (var i in options.extraParams) {
url += "&" + i + "=" + encodeURI(options.extraParams[i]);
autoFill: false,
width: 0
}, $.fn.autocomplete.defaults, options);
-
+
options.width = parseInt(options.width, 10);
return this.each(function() {
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-function EnCryptedResponse() {
- pw1 = document.forms.changepass.nouveau.value;
- pw2 = document.forms.changepass.nouveau2.value;
- if (pw1 != pw2) {
- alert ("\nErreur : les deux champs ne sont pas identiques !")
+function hashResponse(password1, password2, hasConfirmation) {
+ pw1 = $('[name=' + password1 + ']').val();
+
+ if (hasConfirmation) {
+ pw2 = $('[name=' + password2 + ']').val();
+ if (pw1 != pw2) {
+ alert("\nErreur : les deux champs ne sont pas identiques !");
return false;
- exit;
+ }
+ $('[name=' + password2 + ']').val('');
+ } else if (pw1 == '********') {
+ return true;
}
+
if (pw1.length < 6) {
- alert ("\nErreur : le nouveau mot de passe doit faire au moins 6 caractères !")
- return false;
- exit;
+ alert("\nErreur : le nouveau mot de passe doit faire au moins 6 caractères !");
+ return false;
+ }
+ if (!differentTypes(pw1)) {
+ alert ("\nErreur : le nouveau mot de passe doit comporter au moins deux types de caractères parmi les suivants : lettres minuscules, lettres majuscules, chiffres, caractères spéciaux.");
+ return false;
}
- str = hash_encrypt(document.forms.changepass.nouveau.value);
- document.forms.changepass2.response2.value = str;
-
- alert ("Le mot de passe que tu as rentré va être chiffré avant de nous parvenir par Internet ! Ainsi il ne circulera pas en clair.");
- document.forms.changepass2.submit();
+ alert("Le mot de passe que tu as rentré va être chiffré avant de nous parvenir par Internet ! Ainsi il ne circulera pas en clair.");
+ $('[name=' + password1 + ']').val('');
+ $('[name=pwhash]').val(hash_encrypt(pw1));
return true;
}
-function EncryptedResponseInNestedForm() {
- $('[name=nouveau]').val($('[name=password]').val());
- $('[name=nouveau2]').val($('[name=password2]').val());
- EnCryptedResponse();
-}
-
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
}
}
-function checkPassword(box, okLabel) {
+function differentTypes(password) {
var prev = 0;
+
+ for (i = 0 ; i < password.length ; ++i) {
+ var type = getType(password.charAt(i));
+ if (prev != 0 && prev != type) {
+ return true;
+ }
+ prev = type;
+ }
+ return false;
+}
+
+function passwordStrength(password) {
var prop = 0;
- var pass = box.value;
- var types = Array(0, 0, 0, 0, 0);
+ var prev = 0;
var firstType = true;
- for (i = 0 ; i < pass.length ; ++i) {
- type = getType(pass.charAt(i));
+ var types = Array(0, 0, 0, 0, 0);
+
+ for (i = 0 ; i < password.length ; ++i) {
+ var type = getType(password.charAt(i));
if (prev != 0 && prev != type) {
prop += 5;
+ firstType = false;
}
prop += i;
if (types[type] == 0 && !firstType) {
prop += 15;
- } else {
- firstType = false;
}
types[type]++;
prev = type;
}
- if (pass.length < 6) {
+ if (password.length < 6) {
+ prop *= 0.75;
+ }
+ if (firstType) {
prop *= 0.75;
}
if (prop > 100) {
} else if (prop < 0) {
prop = 0;
}
+
+ return prop;
+}
+
+function checkPassword(box, okLabel) {
+ var password = box.value;
+ var prop = passwordStrength(password);
+
if (prop >= 60) {
color = "#4f4";
bgcolor = "#050";
.parent().stop()
.animate({ backgroundColor: bgcolor }, 750);
var submitButton = $(":submit[name='" + passwordprompt_submit + "']");
- if (ok && pass.length >= 6) {
+ if (ok && password.length >= 6 && differentTypes(password)) {
submitButton.attr("value", okLabel);
submitButton.removeAttr("disabled");
} else {
$time = null;
if (!is_null($this->params) && isset($this->params['updateall'])) {
$time = intval($this->params['updateall']);
- S::set('banana_last', $time);
+ S::user()->banana_last = $time;
}
$infos = $this->fetchProfile();
Banana::$profile['signature'] = $infos['sig'];
Banana::$profile['display'] = $infos['threads'];
Banana::$profile['autoup'] = $infos['maj'];
- Banana::$profile['lastnews'] = S::v('banana_last');
+ Banana::$profile['lastnews'] = S::user()->banana_last;
Banana::$profile['subscribe'] = $req->fetchColumn();
Banana::$tree_unread = $infos['tree_unread'];
Banana::$tree_read = $infos['tree_read'];
} else {
$group = '';
}
- return '/rss/' . $group . S::v('hruid') . '/' . S::s('token') . '/rss.xml';
+ return '/rss/' . $group . S::v('hruid') . '/' . S::user()->token . '/rss.xml';
}
function hook_platalMessageLink($params)
function __construct(User &$user, $params = null)
{
- ini_set('memory_limit', '128M');
+ ini_set('memory_limit', '128M');
global $globals;
ModerationBanana::$client = $params['client'];
{
global $globals;
- if (is_null($user) && is_null($profile)) {
+ if (is_null($user)) {
$user = S::user();
- $profile = $user->profile();
+ }
+ if (is_null($profile)) {
+ /* Always refetch the profile. */
+ $profile = $user->profile(true);
}
$email_type = "directory";
// Maximum number of Geocoding calls to the Google Maps API.
const MAX_GMAPS_RPC_CALLS = 5;
+ // Maximum levenshtein distance authorized between input and geocoded text in a single line.
+ const MAX_LINE_DISTANCE = 5;
+ // Maximum levenshtein distance authorized between input and geocoded text in the whole text.
+ const MAX_TOTAL_DISTANCE = 6;
public function getGeocodedAddress(array $address) {
$address = $this->prepareAddress($address);
// cleans up the final informations.
private function getUpdatedAddress(array $address, array $geocodedData, $extraLines) {
$this->fillAddressWithGeocoding(&$address, $geocodedData);
-
- // If the accuracy is 6, it means only the street has been gecoded
- // but not the number, thus we need to fix it.
- if ($address['accuracy'] == 6) {
- $this->fixStreetNumber($address);
- }
-
- // We can now format the address.
$this->formatAddress($address, $extraLines);
-
return $address;
}
$countGeoloc = count($arrayGeoloc);
$countText = count($arrayText);
+ $totalDistance = 0;
if (($countText > $countGeoloc) || ($countText < $countGeoloc - 1)
|| (($countText == $countGeoloc - 1)
&& ($arrayText[$countText - 1] == strtoupper($address['country'])))) {
$same = false;
} else {
for ($i = 0; $i < $countGeoloc && $i < $countText; ++$i) {
- if (levenshtein($arrayText[$i], trim($arrayGeoloc[$i])) > 3) {
+ $lineDistance = levenshtein($arrayText[$i], trim($arrayGeoloc[$i]));
+ $totalDistance += $lineDistance;
+ if ($lineDistance > self::MAX_LINE_DISTANCE || $totalDistance > self::MAX_TOTAL_DISTANCE) {
$same = false;
+ break;
}
}
}
+
if ($same) {
- $address['text'] = $address['geoloc'];
- $address['postalText'] = $address['geocodedPostalText'];
unset($address['geoloc'], $address['geocodedPostalText']);
} else {
$address['geoloc'] = str_replace("\n", "\r\n", $address['geoloc']);
$address['text'] = str_replace("\n", "\r\n", $address['text']);
$address['postalText'] = str_replace("\n", "\r\n", $address['postalText']);
}
-
+
// Returns the address formated for postal use.
// The main rules are (cf AFNOR XPZ 10-011):
// -everything in upper case;
}
return $address['text'];
}
-
- // Search for the lign from the given address that is the closest to the geocoded thoroughfareName
- // and replaces the corresponding lign in the geocoded text by it.
- static protected function fixStreetNumber(&$address)
- {
- if (isset($address['thoroughfareName'])) {
- $thoroughfareName = $address['thoroughfareName'];
- $thoroughfareToken = strtoupper(trim(preg_replace(array("/[,\"'#~:;_\-]/", "/\r\n/"),
- array("", "\n"), $thoroughfareName)));
- $geolocLines = explode("\n", $address['geoloc']);
- $textLines = explode("\n", $address['text']);
- $mindist = strlen($thoroughfareToken);
- $minpos = 0;
- $pos = 0;
- foreach ($textLines as $i => $token) {
- if (($l = levenshtein(strtoupper(trim(preg_replace(array("/[,\"'#~:;_\-]/", "/\r\n/"),
- array("", "\n"), $token))),
- $thoroughfareToken)) < $mindist) {
- $mindist = $l;
- $minpos = $i;
- }
- }
- foreach ($geolocLines as $i => $line) {
- if (strtoupper(trim($thoroughfareName)) == strtoupper(trim($line))) {
- $pos = $i;
- break;
- }
- }
- $geolocLines[$pos] = $textLines[$minpos];
- $address['geoloc'] = implode("\n", $geolocLines);
- }
- }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
global $globals;
if ($from == 'staff' || !($user = User::getSilent($sender))) {
- return '"L\'équipe de Polytechnique.org" <register@' . $globals->mail->domain . '>';
+ return "\"L'équipe de Polytechnique.org\" <register@" . $globals->mail->domain . '>';
}
return '"' . $user->fullName() . '" <' . $user->bestEmail() . '>';
}
}
$sender = substr($this->sender_mail, 1, strpos($this->sender_mail, '"', 2)-1);
$text = str_replace(array('%%hash%%', '%%sender%%', '%%personal_notes%%'),
- array($this->hash, $this->sender_mail, ''), $text);
+ array($this->hash, "Cordialement,\n-- \n" . $this->sender_mail, ''), $text);
$mailer = new PlMailer();
$mailer->setFrom($this->sender_mail);
$mailer->addTo($this->user['mail']);
$this->engine->process($this->user);
if ($valid) {
require_once 'validations.inc.php';
- $valid = new MarkReq(User::getSilent($this->sender), $this->user['user'], $this->user['mail'],
+ $sender = User::getSilent($this->sender);
+ $valid = new MarkReq($sender, $this->user['user'], $this->user['mail'],
$this->from == 'user', $this->type, $this->data, $this->personal_notes);
$valid->submit();
}
}
}
- static public function getAliveUsersCount()
- {
- $uf = new UserFilter(new PFC_Not(new UFC_Dead()));
- return $uf->getTotalCount();
- }
-
static public function relance(PlUser &$user, $nbx = -1)
{
global $globals;
if ($nbx < 0) {
- $nbx = self::getAliveUsersCount();
+ $nbx = $globals->core->NbIns;
}
$res = XDB::fetchOneCell('SELECT r.date, r.email, r.bestalias
. "Pour y figurer, il te suffit de visiter cette page ou de copier cette adresse "
. "dans la barre de ton navigateur :";
if ($from === null) {
- $this->signature = "L'équipe de Polytechnique.org,\n"
- . "Le portail des élèves & anciens élèves de l'École polytechnique";
+ $page = new XorgPage();
+ $page->changeTpl('include/signature.mail.tpl', NO_SKIN);
+ $page->assign('mail_part', 'text');
+ $this->signature = $page->raw();
} else {
- $this->signature = "%%sender%%";
+ $this->signature = '%%sender%%';
}
if (is_null($personal_notes) || $personal_notes == '') {
$this->personal_notes = '%%personal_notes%%';
$page->assign('intro', $this->getIntro());
$page->assign('u', $user);
$page->assign('sign', $this->getSignature());
- $page->assign('num_users', Marketing::getAliveUsersCount());
$page->assign('personal_notes', $this->getPersonalNotes());
}
return $name;
}
-function set_profile_display(&$display_names, $pid)
+function set_profile_display(&$display_names, Profile $profile)
{
XDB::execute("UPDATE profile_display
SET public_name = {?}, private_name = {?},
WHERE pid = {?}",
$display_names['public_name'], $display_names['private_name'],
$display_names['directory_name'], $display_names['short_name'],
- $display_names['sort_name'], $pid);
+ $display_names['sort_name'], $profile->id());
- /* XXX: Inefficient, should directly take the profile as parameter */
- $profile = Profile::get($pid);
$owner = $profile->owner();
if ($owner) {
XDB::execute('UPDATE accounts
- SET full_name = {?}
+ SET full_name = {?}, directory_name = {?}
WHERE uid = {?}',
- $display_names['public_name'], $owner->id());
+ $display_names['public_name'], $display_names['directory_name'], $owner->id());
}
}
* @param $pids An array of pids
* @param $visibility The level of visibility fetched fields must have
* @return a PlIterator yielding data suitable for a "new ProfileBlah($data)"
- * XXX MUST be reimplemented for each kind of ProfileField
+ *
+ * MUST be reimplemented for each kind of ProfileField.
*/
public static function fetchData(array $pids, ProfileVisibility $visibility)
{
$this->$key = $val;
}
$this->company = CompanyList::get($this->jobid);
+ if (is_null($this->company)) {
+ require_once 'validations.inc.php';
+ $entreprise = ProfileValidate::get_typed_requests($this->pid, 'entreprise');
+ $this->company = new Company(array('name' => $entreprise[$this->id]->name));
+ }
}
public function phones()
self::$companies[$row['id']] = $cp;
}
- // TODO: determine whether there can be phones attached to a hq's address
// Add phones to hq
if (count($newcompanies)) {
$it = XDB::iterator('SELECT search_tel AS search, display_tel AS display, comment, link_id, tel_type AS type, link_type, tel_id AS id
function check_account()
{
- return S::v('watch_account');
+ if (S::user()) {
+ return S::user()->watch;
+ }
+ return false;
}
function check_redirect($red = null)
}
$this->val = array($index);
} else {
- $indexes = DirEnum::getIDs($this->direnum, $ufb->t($this->envfield),
+ $indexes = DirEnum::getIDs($this->direnum, $ufb->t($this->envfield),
$ufb->b('exact') ? XDB::WILDCARD_EXACT : XDB::WILDCARD_CONTAINS);
if (count($indexes) == 0) {
return false;
public $profile;
public $profileOwner;
public $userIsProfileOwner;
+ public $ownerIsRegistered;
// }}}
// {{{ constructor
parent::__construct($_user, $_unique, $_type);
$this->profile = &$_profile;
$this->profileOwner = $this->profile->owner();
- if (!is_null($this->profileOwner) && $this->profileOwner->id() == $this->user->id()) {
- $this->userIsProfileOwner = true;
- } else {
- $this->userIsProfileOwner = false;
- }
+ $this->userIsProfileOwner = (!is_null($this->profileOwner)
+ && $this->profileOwner->id() == $this->user->id());
+ $this->ownerIsRegistered = $this->profile->isActive();
}
// }}}
protected function sendmail($isok)
{
- global $globals;
- $mailer = new PlMailer();
- $mailer->setSubject($this->_mail_subj());
- $mailer->setFrom("validation+{$this->type}@{$globals->mail->domain}");
- $mailer->addTo("\"{$this->profile->fullName()}\" <{$this->profileOwner->bestEmail()}>");
- if (!$this->userIsProfileOwner) {
- $mailer->addCc("\"{$this->user->fullName()}\" <{$this->user->bestEmail()}>");
- }
- $mailer->addCc("validation+{$this->type}@{$globals->mail->domain}");
-
- $body = ($this->profile->isFemale() ? "Chère camarade,\n\n" : "Cher camarade,\n\n")
- . $this->_mail_body($isok)
- . (Env::has('comm') ? "\n\n" . Env::v('comm') : '')
- . "\n\nCordialement,\n-- \nL'équipe de Polytechnique.org\n"
- . $this->_mail_ps($isok);
+ // Only sends email if the profile's owner exists and is registered.
+ if ($this->ownerIsRegistered) {
+ global $globals;
- $mailer->setTxtBody(wordwrap($body));
- $mailer->send();
+ $mailer = new PlMailer();
+ $mailer->setSubject($this->_mail_subj());
+ $mailer->setFrom("validation+{$this->type}@{$globals->mail->domain}");
+ $mailer->addTo("\"{$this->profile->fullName()}\" <{$this->profileOwner->bestEmail()}>");
+ $mailer->addCc("validation+{$this->type}@{$globals->mail->domain}");
+ $body = ($this->profile->isFemale() ? "Chère camarade,\n\n" : "Cher camarade,\n\n")
+ . $this->_mail_body($isok)
+ . (Env::has('comm') ? "\n\n" . Env::v('comm') : '')
+ . "\n\nCordialement,\n-- \nL'équipe de Polytechnique.org\n"
+ . $this->_mail_ps($isok);
+ $mailer->setTxtBody(wordwrap($body));
+ $mailer->send();
+ }
}
// }}}
public function id()
{
- if (!is_null($this->profile)) {
- return $this->profile->id() . '_' . $this->type . '_' . $this->stamp;
- } else {
- return $this->user->id() . '_' . $this->type . '_' . $this->stamp;
- }
+ return $this->profile->id() . '_' . $this->type . '_' . $this->stamp;
}
// }}}
$where .= "name LIKE '%" . $name_array[$i] . "%'";
}
}
- $res = XDB::iterator('SELECT name
- FROM profile_job_enum
- WHERE ' . $where);
- $this->suggestions = "| ";
- while ($sug = $res->next()) {
- $this->suggestions .= $sug['name'] . " | ";
+ if ($where != '') {
+ $res = XDB::iterator('SELECT name
+ FROM profile_job_enum
+ WHERE ' . $where);
+ $this->suggestions = "| ";
+ while ($sug = $res->next()) {
+ $this->suggestions .= $sug['name'] . " | ";
+ }
}
}
protected function handle_editor()
{
- if (Env::has('holdingid')) {
- $this->holdingid = Env::t('holdingid');
- }
if (Env::has('name')) {
$this->name = Env::t('name');
- if (Env::has('acronym')) {
- $this->acronym = Env::t('acronym');
- if (Env::has('url')) {
- $this->url = Env::t('url');
- if (Env::has('NAF_code')) {
- $this->NAF_code = Env::t('NAF_code');
- if (Env::has('AX_code')) {
- $this->AX_code = Env::t('AX_code');
- return true;
- }
- }
- }
- }
}
- return false;
+ if (Env::has('acronym')) {
+ $this->acronym = Env::t('acronym');
+ }
+ if (Env::has('url')) {
+ $this->url = Env::t('url');
+ }
+ if (Env::has('email')) {
+ $this->email = Env::t('email');
+ }
+ if (Env::has('holdingid')) {
+ $this->holdingid = Env::i('holdingid');
+ }
+ if (Env::has('NAF_code')) {
+ $this->NAF_code = Env::t('NAF_code');
+ }
+ if (Env::has('AX_code')) {
+ $this->AX_code = Env::i('AX_code');
+ }
+ if (Env::has('address')) {
+ $this->address['text'] = Env::t('address');
+ }
+ if (Env::has('tel')) {
+ $this->tel = Env::t('tel');
+ }
+ if (Env::has('fax')) {
+ $this->fax = Env::t('fax');
+ }
+ return true;
}
// }}}
public function commit()
{
+ /* TODO: refines this filter on promotions by using userfilter. */
if (XDB::execute("INSERT INTO announces
SET uid = {?}, creation_date=NOW(), titre={?}, texte={?},
expiration={?}, promo_min={?}, promo_max={?}, flags=CONCAT(flags,',valide,wiki')",
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-// {{{ class NamesReq4
+// {{{ class NamesReq
class NamesReq extends ProfileValidate
{
{
require_once 'name.func.inc.php';
- set_profile_display($this->display_names, $this->profile->id());
+ set_profile_display($this->display_names, $this->profile);
if (!is_null($this->profileOwner)) {
set_alias_names($this->sn_new, $this->sn_old, $this->profile->id(),
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
-class Ancien
+class Ancien
{
public $NOM_PATR;
public $PART_NOM;
public $NUM_FORMATION = 0;
public $Erreur;
- public function __construct($aa)
+ public function __construct($aa)
{
if ($aa<>'') {
ax_load_object($this, $aa);
public $TEL;
public $FAX;
- public function __construct($aa)
+ public function __construct($aa)
{
ax_load_object($this, $aa);
}
}
}
-class Formation
+class Formation
{
public $LIBELLE;
- public function __construct($aa)
+ public function __construct($aa)
{
ax_load_object($this, $aa);
}
}
-function xml_get_children($vals, &$i)
+function xml_get_children($vals, &$i)
{
$children = array();
if (isset($vals[$i]['value'])) $children[] = $vals[$i]['value'];
if (Post::has('disable_weak_access')) {
$to_update['weak_password'] = null;
} else if (Post::has('update_account')) {
- if (Post::s('full_name') != $user->fullName()) {
- // XXX: Update profile if a profile is associated
- $to_update['full_name'] = Post::s('full_name');
- }
- if (Post::s('display_name') != $user->displayName()) {
- // XXX: Update profile if a profile is associated
- $to_update['display_name'] = Post::s('display_name');
+ if (!$user->hasProfile()) {
+ if (Post::s('full_name') != $user->fullName()) {
+ $to_update['full_name'] = Post::s('full_name');
+ }
+ if (Post::s('display_name') != $user->displayName()) {
+ $to_update['display_name'] = Post::s('display_name');
+ }
+ if (Post::s('directory_name') != $user->directoryName()) {
+ $to_update['directory_name'] = Post::s('directory_name');
+ }
}
if (Post::s('sex') != ($user->isFemale() ? 'female' : 'male')) {
$to_update['sex'] = Post::s('sex');
+ if ($user->hasProfile()) {
+ XDB::execute('UPDATE profiles
+ SET sex = {?}
+ WHERE pid = {?}',
+ Post::s('sex'), $user->profile()->id());
+ }
}
- if (!Post::blank('hashpass')) {
- $to_update['password'] = Post::s('hashpass');
+ if (!Post::blank('pwhash')) {
+ $to_update['password'] = Post::s('pwhash');
+ require_once 'googleapps.inc.php';
$account = new GoogleAppsAccount($user);
if ($account->active() && $account->sync_password) {
- $account->set_password(Post::s('hashpass'));
+ $account->set_password(Post::s('pwhash'));
}
}
if (!Post::blank('weak_password')) {
}
}
if (!empty($to_update)) {
- // TODO: fetch the initial values of the fields, and eventually send
- // a summary of the changes to an admin.
+ $res = XDB::query('SELECT *
+ FROM accounts
+ WHERE uid = {?}', $user->id());
+ $oldValues = $res->fetchAllAssoc();
+ $oldValues = $oldValues[0];
+
$set = array();
+ $diff = array();
foreach ($to_update as $k => $value) {
- $set[] = XDB::format($k . ' = {?}', $value);
+ $value = XDB::format('{?}', $value);
+ $set[] = $k . ' = ' . $value;
+ $diff[$k] = array($oldValues[$k], trim($value, "'"));
+ unset($oldValues[$k]);
}
XDB::execute('UPDATE accounts
- SET ' . implode(', ', $set) . '
+ SET ' . implode(', ', $set) . '
WHERE uid = ' . XDB::format('{?}', $user->id()));
$page->trigSuccess('Données du compte mise à jour avec succès');
$user = User::getWithUID($user->id());
+
+ /* Formats the $diff and send it to the site administrators. The rules are the folowing:
+ * -formats: password, token, weak_password
+ */
+ foreach (array('password', 'token', 'weak_password') as $key) {
+ if (isset($diff[$key])) {
+ $diff[$key] = array('old value', 'new value');
+ } else {
+ $oldValues[$key] = 'old value';
+ }
+ }
+
+ $mail = new PlMailer('admin/useredit.mail.tpl');
+ $mail->assign('admin', S::user()->hruid);
+ $mail->assign('hruid', $user->hruid);
+ $mail->assign('diff', $diff);
+ $mail->assign('oldValues', $oldValues);
+ $mail->send();
}
// }}}
$page->addJsLink('jquery.ui.core.js');
$page->addJsLink('jquery.ui.tabs.js');
+ $page->addJsLink('password.js');
// Displays last login and last host information.
$res = XDB::query("SELECT start, host
}
$page->assign('user', $user);
+ $page->assign('hasProfile', $user->hasProfile());
// Displays forum bans.
$res = XDB::query("SELECT write_perm, read_perm, comment
if ($infos = self::formatNewUser($page, $line, $separator, $promotion, 6)) {
$sex = self::formatSex($page, $infos[3], $line);
if (!is_null($sex)) {
- $name = $infos[1] . ' ' . $infos[0];
+ $fullName = $infos[1] . ' ' . $infos[0];
+ $directoryName = $infos[0] . ' ' . $infos[1];
$birthDate = self::formatBirthDate($infos[2]);
$xorgId = Profile::getXorgId($infos[4]);
if (is_null($xorgId)) {
XDB::execute('INSERT INTO profile_display (pid, yourself, public_name, private_name,
directory_name, short_name, sort_name, promo)
VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})',
- $pid, $infos[1], $name, $name, $name, $name, $infos[0] . ' ' . $infos[1], $promo);
+ $pid, $infos[1], $fullName, $fullName, $directoryName, $fullName, $directoryName, $promo);
XDB::execute('INSERT INTO profile_education (pid, eduid, degreeid, entry_year, grad_year, flags)
VALUES ({?}, {?}, {?}, {?}, {?}, {?})',
$pid, $eduSchools[Profile::EDU_X], $degreeid, $entry_year, $grad_year, 'primary');
- XDB::execute('INSERT INTO accounts (hruid, type, is_admin, state, full_name, display_name, sex)
+ XDB::execute('INSERT INTO accounts (hruid, type, is_admin, state, full_name, directory_name, display_name, sex)
VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?})',
- $infos['hrid'], $type, 0, 'active', $name, $infos[1], $sex);
+ $infos['hrid'], $type, 0, 'active', $fullName, $directoryName, $infos[1], $sex);
$uid = XDB::insertId();
XDB::execute('INSERT INTO account_profiles (uid, pid, perms)
VALUES ({?}, {?}, {?})',
if ($infos = self::formatNewUser($page, $line, $separator, $type, 4)) {
$sex = self::formatSex($page, $infos[3], $line);
if (!is_null($sex)) {
- XDB::execute('INSERT INTO accounts (hruid, type, is_admin, state, email, full_name, display_name, sex)
+ $fullName = $infos[1] . ' ' . $infos[0];
+ $directoryName = $infos[0] . ' ' . $infos[1];
+ XDB::execute('INSERT INTO accounts (hruid, type, is_admin, state, email, full_name, directory_name, display_name, sex)
VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})',
- $infos['hrid'], $type, 0, 'active', $infos[2], $infos[1] . ' ' . $infos[0], $infos[1], $sex);
+ $infos['hrid'], $type, 0, 'active', $infos[2], $fullName, $directoryName, $infos[1], $sex);
$newAccounts[$infos['hrid']] = $infos[1] . ' ' . $infos[0];
}
}
WHERE pd.promo = {?}', $promo);
while (list($pid, $name, $death) = $res->next()) {
$val = Env::v('death_' . $pid);
- if($val == $death || empty($val)) {
+ if ($val == $death) {
continue;
}
+ if (empty($val)) {
+ $val = null;
+ }
XDB::execute('UPDATE profiles
SET deathdate = {?}, deathdate_rec = NOW()
WHERE pid = {?}', $val, $pid);
- $page->trigSuccess('Ajout du décès de ' . $name . ' le ' . $val . '.');
- if($death == '0000-00-00' || empty($death)) {
+
+ $page->trigSuccess('Édition du décès de ' . $name . ' (' . ($val ? $val : 'ressuscité') . ').');
+ if ($val && ($death == '0000-00-00' || empty($death))) {
$profile = Profile::get($pid);
$profile->clear();
$profile->owner()->clear(false);
INNER JOIN profile_display AS pd ON (p.pid = pd.pid)
WHERE pd.promo = {?}
ORDER BY pd.sort_name', $promo);
- $page->assign('decedes', $res);
+ $page->assign('profileList', $res);
}
function handler_dead_but_active(&$page)
$table_editor->apply($page, $action, $id);
}
- function handler_account_types(&$page, $action = 'list', $id = null)
+ function handler_account_types(&$page, $action = 'list', $id = null)
{
$page->setTitle('Administration - Types de comptes');
$page->assign('title', 'Gestion des types de comptes');
{
if (S::hasAuthToken()) {
$page->setRssLink('Changement Récents',
- '/Site/AllRecentChanges?action=rss&user=' . S::v('hruid') . '&hash=' . S::v('token'));
+ '/Site/AllRecentChanges?action=rss&user=' . S::v('hruid') . '&hash=' . S::user()->token);
}
// update wiki perms
$user =& S::user();
if ($user->hasProfile()) {
- // XXX: Transition table for auth.
+ /* Transition table for authentification. */
$personnal_data = $user->profile()->data();
$personnal_data['matricule'] = $personnal_data['xorg_id'];
$personnal_data['matricule_ax'] = $personnal_data['ax_id'];
}
$page->trigSuccess("Les adresses soumises correspondent à un total de " . count(array_unique($ids)) . " camarades.");
}
- // XXX : no break here, since Vérifier is a subcase of Aperçu.
+ // No break here, since Vérifier is a subcase of Aperçu.
case 'Aperçu':
$this->load('axletter.inc.php');
$al = new AXLetter(array($id, $short_name, $subject, $title, $body, $signature,
if (!$this->_promo_min && !$this->_promo_max && !$this->_subset) {
return '1';
}
+ /* TODO: refines this filter on promotions by using userfilter. */
$where = array();
if ($this->_promo_min) {
$where[] = "((ni.uid = 0 AND ni.promo >= {$this->_promo_min}) OR (ni.uid != 0 AND u.promo >= {$this->_promo_min}))";
return;
}
$page->setRssLink('Polytechnique.org :: Carnet',
- '/carnet/rss/'.S::v('hruid').'/'.S::v('token').'/rss.xml');
+ '/carnet/rss/' . S::v('hruid') . '/' . S::user()->token . '/rss.xml');
}
function handler_index(&$page)
// For XSRF protection, checks both the normal xsrf token, and the special RSS token.
// It allows direct linking to contact adding in the RSS feed.
- if (Env::v('action') && Env::v('token') !== S::v('token')) {
+ if (Env::v('action') && Env::v('token') !== S::user()->token) {
S::assert_xsrf_token();
}
switch (Env::v('action')) {
if ($user->hasProfile()) {
XDB::execute("UPDATE profiles
SET alias_pub = {?}
- WHERE pid = {?}",
+ WHERE pid = {?}",
$value, $user->profile()->id());
}
$visibility = ($value == 'public');
$storage = new EmailStorage(S::user(), 'imap');
$storage->activate();
$page->assign('ok', true);
- $page->assign('prenom', S::v('prenom'));
- $page->assign('sexe', S::v('femme'));
+ $page->assign('yourself', S::user()->displayName());
+ $page->assign('sexe', S::user()->isFemale());
} else if (!S::logged() && $user) {
$storage = new EmailStorage($user, 'imap');
$storage->activate();
$page->assign('ok', true);
- $page->assign('prenom', $user->displayName());
+ $page->assign('yourself', $user->displayName());
$page->assign('sexe', $user->isFemale());
}
}
{
$page->changeTpl('emails/lost.tpl');
- // TODO: Order by promo.
$page->assign('lost_emails',
- XDB::iterator("SELECT a.uid, a.hruid
- FROM accounts AS a
- INNER JOIN email_options AS eo ON (eo.uid = a.uid)
- LEFT JOIN emails AS e ON (a.uid = e.uid AND FIND_IN_SET('active', e.flags))
- WHERE e.uid IS NULL AND FIND_IN_SET('googleapps', eo.storage) = 0 AND
- a.state = 'active'
- ORDER BY a.hruid"));
+ XDB::iterator('SELECT a.uid, a.hruid, pd.promo
+ FROM accounts AS a
+ INNER JOIN email_options AS eo ON (eo.uid = a.uid)
+ LEFT JOIN emails AS e ON (a.uid = e.uid AND FIND_IN_SET(\'active\', e.flags))
+ LEFT JOIN account_profiles AS ap ON (ap.uid = a.uid AND FIND_IN_SET(\'owner\', perms))
+ LEFT JOIN profile_display AS pd ON (ap.pid = pd.pid)
+ WHERE e.uid IS NULL AND FIND_IN_SET(\'googleapps\', eo.storage) = 0
+ AND a.state = \'active\'
+ ORDER BY pd.promo, a.hruid'));
}
function handler_broken_addr(&$page)
{
global $globals;
// Add a new special tip when changing plat/al version
- if ($globals->version != S::v('last_version') && is_null($exclude)) {
+ if ($globals->version != S::user()->last_version && is_null($exclude)) {
XDB::execute('UPDATE accounts
SET last_version = {?}
WHERE uid = {?}',
// Direct link to the RSS feed, when available.
if (S::hasAuthToken()) {
$page->setRssLink('Polytechnique.org :: News',
- '/rss/'.S::v('hruid') .'/'.S::v('token').'/rss.xml');
+ '/rss/' . S::v('hruid') . '/' . S::user()->token . '/rss.xml');
}
// Hide the read event, and reload the page to get to the next event.
return XDB::affectedRows() / 2;
}
- /* Cherche les les anciens présents dans Xorg avec un matricule_ax ne correspondant à rien dans la base de l'AX
+ /* Cherche les les anciens présents dans Xorg avec un matricule_ax ne correspondant à rien dans la base de l'AX
* (mises à part les promo 1921 et 1923 qui ne figurent pas dans les données de l'AX)*/
private static function find_wrong_in_xorg($limit = 10)
{
`Date_maj` = CONCAT(SUBSTRING(@StringDate_maj,7),'-',SUBSTRING(@StringDate_maj,4,2),'-',SUBSTRING(@StringDate_maj,1,2));
LOAD DATA LOCAL INFILE 'Activites.txt' INTO TABLE `fusionax_adresses` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
-(provenance, id_ancien, @Code_etab, @Raison_sociale, @Libelle_fonctio, @Annuaire,
+(provenance, id_ancien, @Code_etab, @Raison_sociale, @Libelle_fonctio, @Annuaire,
Ligne1, Ligne2, Ligne3, code_postal, ville, zip_cedex, etat_distr, pays, tel, fax, @StringDate_maj)
SET
`Type_adr` = 'E',
s/\tès /\t/g;
s/\tof /\t/g;
s/( )+(\t)/\t/g;
-
+
# On remet dans l'ordre lorsque le diplôme se situe après l'université
s/Manag\.Vanderblit/Vanderbilt University\tManagement/;
#unrar e -inul export_4D.txt.rar
cp /home/x2004jacob/export*utf8.TXT .
-# séparation en fichiers de tables
+# séparation en fichiers de tables
cat export_total* | grep ^AD > Adresses.txt
cat export_total* | grep ^AN > Anciens.txt
cat export_total* | grep ^FO > Formations.txt
require_once("emails.inc.php");
require_once("googleapps.inc.php");
$page->changeTpl('googleapps/index.tpl');
- $page->addJsLink('motdepasse.js');
+ $page->addJsLink('password.js');
$page->setTitle('Compte Google Apps');
$user = S::user();
} else {
$account->set_password_sync(false);
}
- } elseif ($action == 'password' && Post::has('response2') && !$account->sync_password) {
+ } elseif ($action == 'password' && Post::has('pwhash') && Post::t('pwhash') && !$account->sync_password) {
S::assert_xsrf_token();
- $account->set_password(Post::v('response2'));
+ $account->set_password(Post::t('pwhash'));
}
if ($action == 'suspend' && Post::has('suspend') && $account->active()) {
if ($password_sync) {
$password = $user->password();
} else {
- $password = Post::v('response2');
+ $password = Post::t('pwhash');
}
$account->create($password_sync, $password, $redirect_mails);
}
$this->prepare_client($page);
$members = $this->client->get_members($liste);
- $list = list_fetch_names(list_extract_members($members[1]));
+ $list = list_fetch_basic_info(list_extract_members($members[1]));
pl_content_headers("text/x-csv");
- echo "email,nom,prenom,promo\n";
- foreach ($list as $member) {
- echo @$member['email'] . ',' . @$member['nom'] . ',' . @$member['prenom'] . ',' . @$member['promo'] . "\n";
- }
+ echo "email,nom,promo\n";
+ echo implode("\n", $list);
exit;
}
foreach($members as $mem) {
$user = User::getSilent($mem);
if (!$user) {
- $membres[0][] = array('l' => $mem, 'p' => (!$tri_promo ? 'inconnue' : null));
+ $membres[0][] = array('l' => $mem, 'p' => (!$tri_promo ? 'inconnue' : null), 'n' => null, 'x' => null, 'b' => null);
} else {
$uid = $user->id();
- $nom = $user->fullName(); # XXX: Get a notion of 'last name' here, I want to sort user by lastnames
+ $nom = $user->directoryName();
$promo = $user->promo();
if (!$promo) {
$promo = 'non-X';
}
- $broken = false; # XXX: fill it with the good value if the user has no valid email
$key = $tri_promo ? ($promo != 'non-X' ? $promo : 0) : strtoupper(@$nom{0});
if ($tri_promo) {
$promo = null;
}
- $membres[$key][$nom.$mem] = Array('n' => $nom, 'l' => $mem, 'p' => $promo, 'x' => $uid, 'b' => $broken);
+ $membres[$key][$nom.$mem] = array('n' => $nom, 'l' => $mem, 'p' => $promo, 'x' => $uid, 'b' => $user->lost);
}
}
}
// }}}
+// {{{ function list_fetch_basic_info
-function list_fetch_names($members)
+function list_fetch_basic_info($members)
{
$res = array();
foreach ($members as $member) {
$user = User::getSilent($member);
if (!$user) {
- $res[] = $member;
+ $res[] = $member . ',,';
} else {
- $res[] = $user->fullName();
+ $res[] = $user->forlifeEmail() . ',' . $user->directoryName() . ',' . $user->promo();
}
}
return $res;
<MultiPg>
-<NoDoc>
+<NoDoc>
<UseLocalTime>
<MsgLocalDateFmt>
%d-%m-%y
<FieldsBeg>
<table class="bicol" cellpadding="0" cellspacing="0">
</FieldsBeg>
-
+
<LabelBeg>
<tr>
<td class="right">
<LabelEnd>
</td>
</LabelEnd>
-
+
<FldBeg>
<td>
</FldBeg>
</td>
</tr>
</FldEnd>
-
+
<FieldsEnd>
</table>
</FieldsEnd>
<!-- ------------------------------------------------------------------------ -->
<TIdxPgSSMarkup>
-
+
</TIdxPgSSMarkup>
<TIdxPgBegin>
<IdxPgSSMarkup>
-
+
</IdxPgSSMarkup>
<IdxPgBegin>
function handler_marketing(&$page)
{
$page->changeTpl('marketing/index.tpl');
-
$page->setTitle('Marketing');
- $page->trigWarning("Les statistiques sont momentanéement désactivées");
+
+ $alive = new UserFilter(new PFC_Not(new UFC_Dead()));
+ $registered = new UserFilter(new PFC_And(new UFC_Registered(), new PFC_Not(new UFC_Dead())));
+ $alive72 = new UserFilter(new PFC_And(new UFC_Promo('>=', UserFilter::GRADE_ING, 1972), new PFC_Not(new UFC_Dead())));
+ $registered72 = new UserFilter(new PFC_And(new UFC_Registered(), new UFC_Promo('>=', UserFilter::GRADE_ING, 1972), new PFC_Not(new UFC_Dead())));
+ $aliveWomen = new UserFilter(new PFC_And(new UFC_Sex(User::GENDER_FEMALE) , new PFC_Not(new UFC_Dead())));
+ $registeredWomen = new UserFilter(new PFC_And(new UFC_Registered(), new UFC_Sex(User::GENDER_FEMALE), new PFC_Not(new UFC_Dead())));
+ $statistics = array(
+ 'alive' => $alive->getTotalCount(),
+ 'registered' => $registered->getTotalCount(),
+ 'alive72' => $alive72->getTotalCount(),
+ 'registered72' => $registered72->getTotalCount(),
+ 'womenAlive' => $aliveWomen->getTotalCount(),
+ 'womenRegistered' => $registeredWomen->getTotalCount(),
+ );
+ $statistics['registeredRate'] = $statistics['registered'] / $statistics['alive'] * 100;
+ $statistics['registeredRate72'] = $statistics['registered72'] / $statistics['alive72'] * 100;
+ $statistics['womenRegisteredRate'] = $statistics['womenRegistered'] / $statistics['womenAlive'] * 100;
+
+ $registeredWeek = new UserFilter(new PFC_And(new UFC_Registered(false, '>=', strtotime('1 week ago')), new PFC_Not(new UFC_Dead())));
+ $registrationPending = XDB::fetchOneCell('SELECT COUNT(*)
+ FROM register_pending');
+ $registrations = array(
+ 'week' => $registeredWeek->getTotalCount(),
+ 'pending' => $registrationPending,
+ );
+
+ $ok = XDB::fetchOneCell('SELECT COUNT(*)
+ FROM register_mstats
+ WHERE success != \'0000-00-00\'');
+ $okWeek = XDB::fetchOneCell('SELECT COUNT(*)
+ FROM register_mstats
+ WHERE success >= {?}', strtotime('1 week ago'));
+ $res = XDB::fetchAllAssoc('SELECT type, COUNT(*) as count
+ FROM register_marketing
+ GROUP BY type');
+ $no = array();
+ foreach ($res as $value) {
+ $no[$value['type']] = $value['count'];
+ }
+ $no['week'] = XDB::fetchOneCell('SELECT COUNT(*)
+ FROM register_marketing
+ WHERE last >= {?}', strtotime('1 week ago'));
+ $marketings = array(
+ 'ok' => $ok,
+ 'okWeek' => $okWeek,
+ 'noPerso' => (isset($no['user']) ? $no['user'] : 0),
+ 'noXorg' => (isset($no['staff']) ? $no['staff'] : 0),
+ 'noAX' => (isset($no['ax']) ? $no['ax'] : 0),
+ 'noWeek' => $no['week'],
+ );
+
+ $page->assign('statistics', $statistics);
+ $page->assign('registrations', $registrations);
+ $page->assign('marketings', $marketings);
}
function handler_private(&$page, $hruid = null,
require_once 'marketing.inc.php';
$sender = User::getSilent(S::v('uid'));
+ $perso_signature = 'Cordialement,<br />-- <br />' . $sender->fullName();
$market = new AnnuaireMarketing(null, true);
$text = $market->getText(array(
'sexe' => $user->isFemale(),
$text = str_replace('%%hash%%', '', $text);
$text = str_replace('%%personal_notes%%', '<em id="personal_notes_display"></em>', $text);
$text = str_replace('%%sender%%',
- "<span id=\"sender\">" . $sender->fullName() . '</span>', $text);
+ '<span id="sender">' . $perso_signature . '</span>', $text);
$page->assign('text', nl2br($text));
- // TODO (JAC): define a unique Xorg signature for all the emails we send.
- $page->assign('xorg_signature', "L'équipe de Polytechnique.org,<br />Le portail des élèves & anciens élèves de l'École polytechnique");
- $page->assign('perso_signature', $sender->fullName());
+ $page->assign('perso_signature', $perso_signature);
+ $page->assign('mail_part', 'escaped_html');
}
}
$page->changeTpl('marketing/relance.tpl');
if (Post::has('relancer')) {
- $nbdix = Marketing::getAliveUsersCount();
+ global $globals;
+ $nbdix = $globals->core->NbIns;
$sent = Array();
$users = User::getBulkUsersWithUIDs($_POST['relance']);
if ($eid = $res->fetchOneCell()) {
require_once dirname(__FILE__) . '/xnetevents/xnetevents.inc.php';
$evt = get_event_detail($eid);
- subscribe_lists_event(0, $uid, $evt, $montant, true);
+ subscribe_lists_event($uid, $evt, 1, $montant, true);
}
/* on genere le mail de confirmation */
function handler_cyber2_return(&$page, $uid = null)
{
global $globals, $platal;
-
+
/* on vérifie la signature */
$vads_params = array();
foreach($_REQUEST as $key => $value)
//if($signature != Env::v('signature')) {
// cb_erreur("signature invalide");
//}
-
+
/* on extrait les informations sur l'utilisateur */
$user = User::get(Env::v('vads_cust_id'));
if (!$user) {
if (!list($conf_mail, $conf_title, $conf_text) = $res->fetchOneRow()) {
cb_erreur("référence de commande inconnue");
}
-
+
/* on extrait le montant */
if (Env::v('vads_currency') != "978") {
cb_erreur("monnaie autre que l'euro");
if (Env::v('vads_result') != "00") {
cb_erreur("erreur lors du paiement : ?? (".Env::v('vads_result').")");
}
-
+
/* on fait l'insertion en base de donnees */
XDB::execute("INSERT INTO payment_transactions (id, uid, ref, fullref, amount, pkey, comment)
VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?})",
Env::v('vads_trans_date'), $user->id(), $ref, Env::v('vads_order_id'), $montant, "", Env::v('vads_order_info'));
echo "Paiement stored.\n";
-
+
// We check if it is an Xnet payment and then update the related ML.
$res = XDB::query('SELECT eid
FROM group_events
if ($eid = $res->fetchOneCell()) {
require_once dirname(__FILE__) . '/xnetevents/xnetevents.inc.php';
$evt = get_event_detail($eid);
- subscribe_lists_event(0, $user->id(), $evt, $montant, true);
+ subscribe_lists_event($user->id(), $evt, 1, $montant, true);
}
/* on genere le mail de confirmation */
if ($eid = $res->fetchOneCell()) {
require_once dirname(__FILE__) . '/xnetevents/xnetevents.inc.php';
$evt = get_event_detail($eid);
- subscribe_lists_event(0, $uid, $evt, $montant, true);
+ subscribe_lists_event($user->id(), $evt, 1, $montant, true);
}
/* on genere le mail de confirmation */
$prefix = ($pay->flags->hasflag('unique')) ? str_pad("",15,"0") : rand_url_id();
$fullref = substr("$prefix-{$pay->id}",-12); // FIXME : check for duplicates
$ts = time();
- $trans_date = date("YmdHis", $ts);
+ $trans_date = date("YmdHis", $ts);
$trans_id = date("His", $ts); // FIXME : check for duplicates
- // contenu du formulaire
+ // contenu du formulaire
$this->urlform = "https://systempay.cyberpluspaiement.com/vads-payment/";
$this->infos['commercant'] = Array(
'vads_site_id' => $globals->money->cyperplus_account,
'vads_ctx_mode' => $globals->money->cyperplus_prod,
'vads_page_action' => 'PAYMENT',
'vads_action_mode' => 'INTERACTIVE');
-
+
// calcul de la clé d'acceptation en entrée
$all_params = array_merge($this->infos['commercant'],$this->infos['client'],$this->infos['commande'],$this->infos['divers']);
ksort($all_params);
function __set_rss_state($state)
{
if ($state) {
- S::set('token', rand_url_id(16));
+ S::user()->token = rand_url_id(16);
XDB::execute('UPDATE accounts
SET token = {?}
- WHERE uid = {?}', S::s('token'), S::i('uid'));
+ WHERE uid = {?}', S::user()->token, S::i('uid'));
} else {
S::kill('token');
XDB::execute('UPDATE accounts
if (Post::has('email_format')) {
$fmt = Post::s('email_format');
S::user()->setEmailFormat($fmt);
- S::set('email_format', $fmt);
}
if (Post::has('rss')) {
{
global $globals;
- if (Post::has('response2')) {
+ if (Post::has('pwhash') && Post::t('pwhash')) {
S::assert_xsrf_token();
- S::set('password', $password = Post::v('response2'));
+ S::set('password', $password = Post::t('pwhash'));
XDB::execute('UPDATE accounts
SET password = {?}
WHERE uid={?}', $password,
S::logger()->log('passwd');
Platal::session()->setAccessCookie(true);
- $page->changeTpl('platal/motdepasse.success.tpl');
+ $page->changeTpl('platal/password.success.tpl');
$page->run();
}
- $page->changeTpl('platal/motdepasse.tpl');
- $page->addJsLink('motdepasse.js');
+ $page->changeTpl('platal/password.tpl');
+ $page->addJsLink('password.js');
$page->setTitle('Mon mot de passe');
}
}
$uid = $ligne["uid"];
- if (Post::has('response2')) {
- $password = Post::v('response2');
+ if (Post::has('pwhash') && Post::t('pwhash')) {
+ $password = Post::t('pwhash');
XDB::query('UPDATE accounts
SET password={?}
WHERE uid = {?} AND state = \'active\'',
S::logger($uid)->log("passwd", "");
$page->changeTpl('platal/tmpPWD.success.tpl');
} else {
- $page->changeTpl('platal/motdepasse.tpl');
- $page->addJsLink('motdepasse.js');
+ $page->changeTpl('platal/password.tpl');
+ $page->addJsLink('password.js');
}
}
}
}
- function handler_review(&$page, $action = null, $mode = null)
+ function handler_review(&$page, $action = null, $mode = null)
{
// Include X-XRDS-Location response-header for Yadis discovery
global $globals;
);
}
- /* XXX COMPAT */
+ /* Function needed for compatibility reasons.
+ * TODO: removes calls to fiche.php?user=blah.machin.2083 and then removes this.
+ */
function handler_fiche(&$page)
{
return $this->handler_profile($page, Env::v('user'));
$view = 'private';
}
+ // Display pending picture
+ if (S::logged() && Env::v('modif') == 'new') {
+ $page->assign('with_pending_pic', true);
+ }
+
// Fetches profile's and profile's owner information and redirects to
// marketing if the owner has not subscribed and the requirer has logged in.
$profile = Profile::get($pid, Profile::FETCH_ALL, $view);
function handler_admin_education_degree(&$page, $action = 'list', $id = null) {
$page->setTitle('Administration - Niveau de formation');
$page->assign('title', 'Gestion des niveau de formation');
- $table_editor = new PLTableEditor('admin/education_degree', 'profile_education_degree_enum', 'id', true);
+ $table_editor = new PLTableEditor('admin/education_degree', 'profile_education_degree_enum', 'id');
$table_editor->add_join_table('profile_education_degree', 'degreeid', true);
$table_editor->add_join_table('profile_education', 'degreeid', true);
$table_editor->describe('degree', 'niveau', true);
$profiletel->saveTels($page->pid(), 'tel', $address['tel']);
}
}
+
+ public function getText($value) {
+ $addresses = array();
+ foreach ($value as $addrid => $address) {
+ $phones = new ProfileSettingPhones('address', $addrid);
+ $addresses[] = 'Adresse : ' . $address['text'] . ', affichage : ' . $address['pub']
+ . ', commentaire : ' . $address['comment'] . ', actuelle : ' . ($address['current'] ? 'oui' : 'non')
+ . ', temporaire : ' . ($address['temporary'] ? 'oui' : 'non') . ', secondaire : '
+ . ($address['secondary'] ? 'oui' : 'non') . ', conctactable par courier : '
+ . ($address['mail'] ? 'oui' : 'non') . ', ' . $phones->getText($address['tel']);
+ }
+ return implode(' ; ' , $addresses);
+ }
}
class ProfileSettingAddresses extends ProfilePage
}
}
}
+
+ public function getText($value) {
+ $medalsList = DirEnum::getOptions(DirEnum::MEDALS);
+ $medals = array();
+ foreach ($value as $id => $medal) {
+ $medals[] = $medalsList[$id];
+ }
+ return implode(', ', $medals);
+ }
}
class ProfileSettingDecos extends ProfilePage
public function _prepare(PlPage &$page, $id)
{
- $res = XDB::iterator("SELECT *, FIND_IN_SET('validation', flags) AS validate
- FROM profile_medal_enum
- ORDER BY type, text");
- $mlist = array();
+ $res = XDB::iterator('SELECT *, FIND_IN_SET(\'validation\', flags) AS validate
+ FROM profile_medal_enum
+ ORDER BY type, text');
+ $mlist = array();
while ($tmp = $res->next()) {
$mlist[$tmp['type']][] = $tmp;
}
$page->assign('medal_list', $mlist);
- $trad = Array('ordre' => 'Ordres',
- 'croix' => 'Croix',
- 'militaire' => 'Médailles militaires',
- 'honneur' => 'Médailles d\'honneur',
- 'resistance' => 'Médailles de la résistance',
- 'prix' => 'Prix');
- $page->assign('trad', $trad);
+ $fullType = array(
+ 'ordre' => 'Ordres',
+ 'croix' => 'Croix',
+ 'militaire' => 'Médailles militaires',
+ 'honneur' => 'Médailles d\'honneur',
+ 'resistance' => 'Médailles de la résistance',
+ 'prix' => 'Prix',
+ 'sport' => 'Médailles sportives'
+ );
+ $page->assign('fullType', $fullType);
}
}
$value[] = $sn;
} while ($sn = $sn_all->next());
}
+ require_once 'validations.inc.php';
+ $namesRequest = ProfileValidate::get_typed_requests($page->pid(), 'usage');
+ if (count($namesRequest) > 0) {
+ Platal::page()->assign('validation', true);
+ }
$value = $this->clean($value);
} else {
require_once 'name.func.inc.php';
$display_names = array();
build_display_names($display_names, $this->search_names,
$page->profile->isFemale(), $this->private_name_end);
- set_profile_display($display_names, $page->pid());
+ set_profile_display($display_names, $page->profile);
+ }
+ }
+
+ public function getText($value) {
+ $names = array();
+ foreach ($value as $name) {
+ if ($name['name'] != '') {
+ $names[] = $name['type_name'] . ' : ' . $name['name'];
+ }
}
+ return implode(', ' , $names);
}
}
}
}
}
+
+ public function getText($value) {
+ $schoolsList = DirEnum::getOptions(DirEnum::EDUSCHOOLS);
+ $degreesList = DirEnum::getOptions(DirEnum::EDUDEGREES);
+ $fieldsList = DirEnum::getOptions(DirEnum::EDUFIELDS);
+ $educations = array();
+ foreach ($value as $education) {
+ $educations[] = 'Université : ' . $schoolsList[$education['eduid']]
+ . ', diplôme : ' . $degreesList[$education['degreeid']]
+ . ', domaine : ' . $fieldsList[$education['fieldid']]
+ . ', année d\'obtention : ' . $education['grad_year']
+ . ', intitulé : ' . $education['program'];
+ }
+ return implode(', ', $educations);
+ }
}
class ProfileSettingEmailDirectory implements ProfileSetting
}
return $value;
}
+
+ public function getText($value) {
+ return $value;
+ }
}
class ProfileSettingNetworking implements ProfileSetting
$page->pid(), $id, $network['type'], $network['address'], $network['pub']);
}
}
+
+ public function getText($value) {
+ $networkings = array();
+ foreach ($value as $network) {
+ $networkings[] = 'nom : ' . $network['name'] . ', adresse : ' . $network['address']
+ . ', affichage : ' . $network['pub'];
+ }
+ return implode(' ; ' , $networkings);
+ }
}
class ProfileSettingPromo implements ProfileSetting
}
return intval($value);
}
+
+ public function getText($value) {
+ return $value;
+ }
}
LEFT JOIN profile_phones AS pp ON (pp.pid = p.pid AND link_type = 'user')
WHERE p.pid = {?}", $this->pid());
$this->values = $res->fetchOneAssoc();
- if ($this->owner) {
- $this->values['yourself'] = $this->owner->displayName();
- }
// Retreive photo informations
$res = XDB::query("SELECT pub
$page->assign('edu_fields', $res->fetchAllAssoc());
require_once "emails.combobox.inc.php";
- fill_email_combobox($page, $this->owner, $this->profile);
+ fill_email_combobox($page, $this->owner);
$res = XDB::query("SELECT nw.nwid AS type, nw.name
FROM profile_networking_enum AS nw
WHERE pid = {?}",
$value, $page->pid());
}
+
+ public function getText($value) {
+ $sectionsList = DirEnum::getOptions(DirEnum::SECTIONS);
+ return $sectionsList[$value];
+ }
}
class ProfileSettingBinets implements ProfileSetting
XDB::execute("INSERT INTO profile_binets (pid, binet_id)
VALUES " . implode(',', $insert));
}
+
+ public function getText($value) {
+ return implode(', ', $value);
+ }
}
class ProfileSettingGroups extends ProfilePage
WHERE a.inscriptible != 0
AND (a.cat = 'GroupesX' OR a.cat = 'Institutions')
ORDER BY a.cat, a.dom, a.nom"));
- $page->assign('old', (int) date('Y') >= $page->profile->grad_year);
+ $page->assign('old', (int) date('Y') >= $this->profile->grad_year);
}
}
$job['hq_email'], $job['hq_fixed'], $job['hq_fax'], $job['hq_address']);
$req->submit();
$job['jobid'] = null;
+ sleep(1);
} else {
$job['jobid'] = $res->fetchOneCell();
}
}
}
}
+
+ public function getText($value) {
+ $jobs = array();
+ foreach ($value as $id => $job) {
+ $address = new ProfileSettingAddress();
+ $phones = new ProfileSettingPhones('pro', $id);
+ $jobs[] = 'Entreprise : ' . $job['name'] . ', secteur : ' . $job['subSubSectorName']
+ . ', description : ' . $job['description'] . ', web : ' . $job['w_url']
+ . ', email : ' . $job['w_email']
+ . ', ' . $phones->getText($job['w_phone']) . ', ' . $address->getText($job['w_address']);
+ }
+ return implode(' ; ' , $jobs);
+ }
+}
+
+class ProfileSettingCorps implements ProfileSetting
+{
+ public function value(ProfilePage &$page, $field, $value, &$success)
+ {
+ $success = true;
+ if (is_null($value)) {
+ $res = XDB::query("SELECT original_corpsid AS original, current_corpsid AS current,
+ rankid AS rank, corps_pub AS pub
+ FROM profile_corps
+ WHERE pid = {?}",
+ $page->pid());
+ return $res->fetchOneAssoc();
+ }
+ return $value;
+ }
+
+ public function save(ProfilePage &$page, $field, $value)
+ {
+ XDB::execute('REPLACE INTO profile_corps (original_corpsid, current_corpsid, rankid, corps_pub, pid)
+ VALUES ({?}, {?}, {?}, {?}, {?})',
+ $value['original'], $value['current'], $value['rank'], $value['pub'], $page->pid());
+ }
+
+ public function getText($value)
+ {
+ $corpsList = DirEnum::getOptions(DirEnum::CORPS);
+ $rankList = DirEnum::getOptions(DirEnum::CORPSRANKS);
+ return 'Corps actuel : ' . $corpsList[$value['current']] . ' , rang : ' . $corpsList[$value['rank']]
+ . ' , corps d\'origine : ' . $corpsList[$value['original']] . ' , affichage : ' . $value['pub'];
+ }
}
class ProfileSettingJobs extends ProfilePage
{
parent::__construct($wiz);
$this->settings['cv'] = null;
- $this->settings['corps'] = null;
+ $this->settings['corps'] = new ProfileSettingCorps();
$this->settings['jobs'] = new ProfileSettingJob();
$this->watched = array('cv' => true, 'jobs' => true, 'corps' => true);
}
$this->pid());
$this->values['cv'] = $res->fetchOneCell();
- // Checkout the corps
- $res = XDB::query("SELECT original_corpsid AS original, current_corpsid AS current,
- rankid AS rank, corps_pub AS pub
- FROM profile_corps
- WHERE pid = {?}",
- $this->pid());
- $this->values['corps'] = $res->fetchOneAssoc();
-
// Build the jobs tree
$res = XDB::iterRow("SELECT j.id, j.jobid, je.name, j.sectorid, j.subsectorid, j.subsubsectorid,
s.name, j.description, j.email, j.email_pub, j.url, j.pub,
);
}
}
-
+
$job['w_email_new'] = '';
if (!isset($job['hq_phone'])) {
$job['hq_phone'] = '';
WHERE pid = {?}",
$this->values['cv'], $this->pid());
}
-
- if ($this->changed['corps']) {
- XDB::execute('REPLACE INTO profile_corps (original_corpsid, current_corpsid, rankid, corps_pub, pid)
- VALUES ({?}, {?}, {?}, {?}, {?})',
- $this->values['corps']['original'], $this->values['corps']['current'],
- $this->values['corps']['rank'], $this->values['corps']['pub'], $this->pid());
- }
}
public function _prepare(PlPage &$page, $id)
{
require_once 'emails.combobox.inc.php';
- fill_email_combobox($page, $this->owner, $this->profile);
+ fill_email_combobox($page, $this->owner);
$res = XDB::query("SELECT id, name AS label
FROM profile_job_sector_enum");
}
}
}
+
+ public function getText($value) {
+ $sectors = array();
+ foreach ($value as $sector) {
+ foreach ($sector as $subsector) {
+ $sectors[] = $subsector;
+ }
+ }
+ return implode(', ', $sectors);
+ }
}
class ProfileSettingCountry implements ProfileSetting
$page->pid(), $id);
}
}
+
+ public function getText($value) {
+ return implode(', ', $value);
+ }
}
$page->assign('countryList', XDB::iterator("SELECT iso_3166_1_a2, countryFR
FROM geoloc_countries
ORDER BY countryFR"));
+ $page->assign('hrpid', $this->profile->hrpid);
}
}
/** Save the new value for the given field.
*/
public function save(ProfilePage &$page, $field, $new_value);
+
+ /** Get text from the value.
+ */
+ public function getText($value);
}
abstract class ProfileNoSave implements ProfileSetting
{
public function save(ProfilePage &$page, $field, $new_value) { }
+
+ public function getText($value) {
+ return $value;
+ }
}
class ProfileSettingWeb extends ProfileNoSave
$this->saveTel($pid, $telid, $phone);
}
}
+
+ public function getText($value) {
+ $phones = array();
+ foreach ($value as $phone) {
+ if ($phone['tel'] != '') {
+ $phones[] = 'type : ' . $phone['type'] .', numéro : ' . $phone['tel']
+ . ', commentaire : « ' . $phone['comment'] . ' », affichage : ' . $phone['pub'];
+ }
+ }
+ return implode(' ; ' , $phones);
+ }
}
class ProfileSettingPub extends ProfileNoSave
}
return $value;
}
+
+ public function getText($value) {
+ return $value;
+ }
}
class ProfileSettingBool extends ProfileNoSave
$address = $gmapsGeocoder->stripGeocodingFromAddress($address);
}
}
+
+ public function getText($value) {
+ return $value;
+ }
}
protected function saveData()
{
require_once 'notifs.inc.php';
+ $changedFields = array();
foreach ($this->settings as $field=>&$setting) {
- if (!is_null($setting) && $this->changed[$field]) {
- $setting->save($this, $field, $this->values[$field]);
- }
- if ($this->changed[$field] && @$this->watched[$field]) {
- WatchProfileUpdate::register($this->profile, $field);
+ if ($this->changed[$field]) {
+ if (!is_null($setting)) {
+ $changedFields[$field] = array(
+ str_replace("\n", " - ", $setting->getText($this->orig[$field])),
+ str_replace("\n", " - ", $setting->getText($this->values[$field])),
+ );
+ } else {
+ $changedFields[$field] = array(
+ str_replace("\n", " - ", $this->orig[$field]),
+ str_replace("\n", " - ", $this->values[$field]),
+ );
+ }
+ if (!is_null($setting)) {
+ $setting->save($this, $field, $this->values[$field]);
+ }
+ if (isset($this->watched[$field]) && $this->watched[$field]) {
+ WatchProfileUpdate::register($this->profile, $field);
+ }
}
}
$this->_saveData();
WHERE pid = {?}', $this->pid());
global $platal;
S::logger()->log('profil', $platal->pl_self(2));
+
+ /** If the update was made by a third party and the profile corresponds
+ * to a registered user, stores both former and new text.
+ * This will be daily sent to the user.
+ */
+ $owner = $this->profile->owner();
+ $user = S::user();
+ if ($owner->isActive() && $owner->id() != $user->id()) {
+ foreach ($changedFields as $field => $values) {
+ XDB::execute('REPLACE INTO profile_modifications (pid, uid, field, oldText, newText)
+ VALUES ({?}, {?}, {?}, {?}, {?})',
+ $this->pid(), $user->id(), $field, $values[0], $values[1]);
+ }
+ }
}
protected function checkChanges()
$page->pid(), $id, $skill['level']);
}
}
+
+ public function getText($value) {
+ $skills = array();
+ foreach ($value as $skill) {
+ $skills[] = 'Compétance : ' . $skill['text'] . ', niveau : ' . $skill['level'];
+ }
+ return implode(' ; ' , $skills);
+ }
}
class ProfileSettingSkills extends ProfilePage
$subState->set('services', $services);
// Validate the password.
- if (!Post::v('response2', false)) {
+ if (!Post::v('pwhash', false)) {
$error[] = "Le mot de passe n'est pas valide.";
}
$subState->set('birthdate', sprintf("%04d-%02d-%02d",
intval($birth[2]), intval($birth[1]), intval($birth[0])));
$subState->set('email', Post::t('email'));
- $subState->set('password', Post::t('response2'));
+ $subState->set('password', Post::t('pwhash'));
// Update the current alert if the birthdate is incorrect,
// or if the IP address of the user has been banned.
}
$page->changeTpl('register/step' . $subState->i('step') . '.tpl');
- $page->addJsLink('motdepasse.js');
+ $page->addJsLink('password.js');
if (isset($error)) {
$page->trigError($error);
}
//
XDB::execute("UPDATE accounts
SET password = {?}, state = 'active',
- registration_date = NOW()
+ registration_date = NOW(), email = NULL
WHERE uid = {?}", $password, $uid);
XDB::execute("UPDATE profiles
SET birthdate = {?}, last_change = NOW()
if ($nb_tot > $globals->search->private_max) {
$this->form_prepare();
$page->trigError('Recherche trop générale.');
+ } else if ($nb_tot == 0) {
+ $this->form_prepare();
+ $page->trigError('Il n\'existe personne correspondant à ces critères dans la base !');
}
}
$page->assign('cat', $cat);
$page->assign('dom', $dom);
- $res = XDB::query("SELECT id,nom
+ $res = XDB::query("SELECT id,nom
FROM group_dom
WHERE FIND_IN_SET({?}, cat)
ORDER BY nom", $cat);
}
if ($updated !== false) {
$page->trigSuccess('Ton inscription à l\'événement a été mise à jour avec succès.');
- subscribe_lists_event($total, S::i('uid'), $evt, $paid);
+ subscribe_lists_event(S::i('uid'), $evt, ($total > 0 ? 1 : 0), 0);
}
$page->assign('event', get_event_detail($eid));
}
// change the price paid by a participant
if (Env::v('adm') == 'prix' && $member) {
+ $amount = strtr(Env::v('montant'), ',', '.');
XDB::execute("UPDATE group_event_participants
SET paid = paid + {?}
WHERE uid = {?} AND eid = {?} AND item_id = 1",
- strtr(Env::v('montant'), ',', '.'),
- $member->uid, $evt['eid']);
+ $amount, $member->uid, $evt['eid']);
+ subscribe_lists_event($member->uid, $evt, 1, $amount);
}
// change the number of personns coming with a participant
foreach ($nbs as $id => $nb) {
$nb = max(intval($nb), 0);
- XDB::execute("REPLACE INTO group_event_participants
- VALUES ({?}, {?}, {?}, {?}, {?}, {?})",
- $evt['eid'], $member->uid, $id, $nb, '', $id == 1 ? $paid : 0);
+ XDB::execute('REPLACE INTO group_event_participants
+ VALUES ({?}, {?}, {?}, {?}, {?}, {?})',
+ $evt['eid'], $member->uid, $id, $nb, '', $id == 1 ? $paid : 0);
}
- $res = XDB::query("SELECT COUNT(uid) AS cnt, SUM(nb) AS nb
- FROM group_event_participants
- WHERE uid = {?} AND eid = {?}
- GROUP BY uid",
- $member->uid, $evt['eid']);
+ $res = XDB::query('SELECT COUNT(uid) AS cnt, SUM(nb) AS nb
+ FROM group_event_participants
+ WHERE uid = {?} AND eid = {?}
+ GROUP BY uid',
+ $member->uid, $evt['eid']);
$u = $res->fetchOneAssoc();
if ($u['cnt'] == 1 && $paid == 0 && Post::v('cancel')) {
XDB::execute("DELETE FROM group_event_participants
WHERE uid = {?} AND eid = {?}",
$member->uid, $evt['eid']);
$u = 0;
+ subscribe_lists_event($member->uid, $evt, -1, $paid);
} else {
+ var_dump($u);
$u = $u['cnt'] ? $u['nb'] : null;
+ subscribe_lists_event($member->uid, $evt, ($u > 0 ? 1 : 0), $paid);
}
- subscribe_lists_event($u, $member->uid, $evt, $paid);
}
$evt = get_event_detail($eid, $item_id);
$page->assign('absents', $absents);
$page->assign('participants',
get_event_participants($evt, $item_id, UserFilter::sortByName(),
- new PLLimit(NB_PER_PAGE), $ofs * NB_PER_PAGE));
+ NB_PER_PAGE, $ofs * NB_PER_PAGE));
}
}
WHERE ep.eid = {?} AND nb > 0 ' . $append . '
GROUP BY ep.uid', $eid);
$uf = new UserFilter(new PFC_True(), $tri);
- $users = User::getBulkUsersWithUIDs($uf->filter(array_keys($query), $count, $offset));
+ $users = User::getBulkUsersWithUIDs($uf->filter(array_keys($query), new PlLimit($count, $offset)));
$tab = array();
foreach ($users as $user) {
$uid = $user->id();
// }}}
// {{{ function subscribe_lists_event()
-function subscribe_lists_event($participate, $uid, $evt, $paid, $payment = null)
+/** Subscribes user to various event related mailing lists.
+ *
+ * @param $uid: user's id.
+ * @param evt: events data, in particular ids of the lists at stake.
+ * @param participate: indicates if the user takes part at the event or not;
+ * -1 means he did not answer, 0 means no, and 1 means yes.
+ * @param paid: has the user already payed anything?
+ * 0 means no, a positive amount means yes.
+ * @param payment: is this function called from a payment page?
+ * If true, only payment related lists should be updated.
+ */
+function subscribe_lists_event($uid, $evt, $participate, $paid, $payment = false)
{
- global $globals;
- $page =& Platal::page();
-
$participant_list = $evt['participant_list'];
$absent_list = $evt['absent_list'];
$unpayed_list = $evt['booked_unpayed_list'];
function subscribe($list, $email)
{
if ($list && $email) {
- XDB::execute("REPLACE INTO virtual_redirect
- VALUES ({?},{?})",
+ XDB::execute('REPLACE INTO virtual_redirect
+ VALUES ({?}, {?})',
$list, $email);
}
}
function unsubscribe($list, $email)
{
if ($list && $email) {
- XDB::execute("DELETE FROM virtual_redirect
- WHERE vid = {?} AND redirect = {?}",
+ XDB::execute('DELETE FROM virtual_redirect
+ WHERE vid = {?} AND redirect = {?}',
$list, $email);
}
}
- if (is_null($payment)) {
- if (is_null($participate)) {
+ /** If $payment is not null, we do not retrieve the value of $participate,
+ * thus we do not alter participant and absent lists.
+ */
+ if ($payment === true) {
+ if ($paid > 0) {
+ unsubscribe($unpayed_list, $email);
+ subscribe($payed_list, $email);
+ }
+ } else {
+ switch ($participate) {
+ case -1:
unsubscribe($participant_list, $email);
+ unsubscribe($unpayed_list, $email);
+ unsubscribe($payed_list, $email);
subscribe($absent_list, $email);
- } elseif ($participate) {
- subscribe($participant_list, $email);
- unsubscribe($absent_list, $email);
- } else {
+ break;
+ case 0:
unsubscribe($participant_list, $email);
unsubscribe($absent_list, $email);
- }
- }
- if ($paid > 0) {
- unsubscribe($unpayed_list, $email);
- subscribe($payed_list, $email);
- } else {
- unsubscribe($payed_list, $email);
- if (!is_null($participate)) {
- subscribe($unpayed_list, $email);
+ unsubscribe($unpayed_list, $email);
+ unsubscribe($payed_list, $email);
+ break;
+ case 1:
+ subscribe($participant_list, $email);
+ unsubscribe($absent_list, $email);
+ if ($paid > 0) {
+ unsubscribe($unpayed_list, $email);
+ subscribe($payed_list, $email);
+ } else {
+ subscribe($unpayed_list, $email);
+ unsubscribe($payed_list, $email);
+ }
+ break;
}
}
}
Env::i('unread'), S::i('uid'));
pl_redirect("#art" . Env::i('unread'));
}
- // XXX: Fix promo_min; promo_max
- $arts = XDB::iterator("SELECT a.*, FIND_IN_SET('photo', a.flags) AS photo
+
+ /* TODO: refines this filter on promotions by using userfilter. */
+ $user = S::user();
+ if ($user->hasProfile()) {
+ $promo = XDB::format('{?}', $user->profile()->entry_year);
+ $minCondition = ' OR promo_min <= ' . $promo;
+ $maxCondition = ' OR promo_max >= ' . $promo;
+ } else {
+ $minCondition = '';
+ $maxCondition = '';
+ }
+ $arts = XDB::iterator('SELECT a.*, FIND_IN_SET(\'photo\', a.flags) AS photo
FROM group_announces AS a
LEFT JOIN group_announces_read AS r ON (r.uid = {?} AND r.announce_id = a.id)
WHERE asso_id = {?} AND expiration >= CURRENT_DATE()
- AND (promo_min = 0 OR promo_min <= {?})
- AND (promo_max = 0 OR promo_max >= {?})
+ AND (promo_min = 0' . $minCondition . ')
+ AND (promo_max = 0' . $maxCondition . ')
AND r.announce_id IS NULL
- ORDER BY a.expiration",
- S::i('uid'), $globals->asso('id'), S::i('promo'), S::i('promo'));
- $index = XDB::iterator("SELECT a.id, a.titre, r.uid IS NULL AS nonlu
+ ORDER BY a.expiration',
+ S::i('uid'), $globals->asso('id'));
+ $index = XDB::iterator('SELECT a.id, a.titre, r.uid IS NULL AS nonlu
FROM group_announces AS a
LEFT JOIN group_announces_read AS r ON (a.id = r.announce_id AND r.uid = {?})
WHERE asso_id = {?} AND expiration >= CURRENT_DATE()
- AND (promo_min = 0 OR promo_min <= {?})
- AND (promo_max = 0 OR promo_max >= {?})
- ORDER BY a.expiration",
- S::i('uid'), $globals->asso('id'), S::i('promo'), S::i('promo'));
+ AND (promo_min = 0' . $minCondition . ')
+ AND (promo_max = 0' . $maxCondition . ')
+ ORDER BY a.expiration',
+ S::i('uid'), $globals->asso('id'));
$page->assign('article_index', $index);
} else {
$arts = XDB::iterator("SELECT *, FIND_IN_SET('photo', flags) AS photo
$platal->ns . "rss/rss.xml");
} else {
$page->setRssLink("Polytechnique.net :: {$globals->asso("nom")} :: News",
- $platal->ns . 'rss/'.S::v('hruid') .'/'.S::v('token').'/rss.xml');
+ $platal->ns . 'rss/' . S::v('hruid') . '/' . S::user()->token . '/rss.xml');
}
$page->assign('articles', $arts);
S::assert_xsrf_token();
- // Finds or creates account
+ // Finds or creates account: first cases are for users with an account.
if (!User::isForeignEmailAddress($email)) {
- // standard x account
+ // Standard account
$user = User::get($email);
} else if (!isvalid_email($email)) {
// email might not be a regular email but an alias or a hruid
$user = User::get($email);
if (!$user) {
// need a valid email address
- $page->trigError("« <strong>$email</strong> » n'est pas une adresse email valide.");
+ $page->trigError('« <strong>' . $email . '</strong> » n\'est pas une adresse email valide.');
return;
}
} else if (Env::v('x') && Env::i('userid')) {
- // user is an x but might not yet be registered
$user = User::getWithUID(Env::i('userid'));
if (!$user) {
- $page->trigError("Utilisateur invalide");
+ $page->trigError('Utilisateur invalide.');
return;
}
- // add email for marketing if unknown
- if ($user->state == 'pending' && Env::v('market')) {
- $market = Marketing::get($user->uid, $email);
- if (!$market) {
- $market = new Marketing($user->uid, $email, 'group', $globals->asso('nom'),
- Env::v('market_from'), S::v('uid'));
- $market->add();
+
+ // User has an account but is not yet registered.
+ if ($user->state == 'pending') {
+ // Add email in account table.
+ XDB::query('UPDATE accounts
+ SET email = {?}
+ WHERE uid = {?} AND email IS NULL',
+ Post::t('email'), $user->id());
+ // Add email for marketing if required.
+ if (Env::v('market')) {
+ $market = Marketing::get($user->uid, $email);
+ if (!$market) {
+ $market = new Marketing($user->uid, $email, 'group', $globals->asso('nom'),
+ Env::v('market_from'), S::v('uid'));
+ $market->add();
+ }
}
}
} else {
- // user is not an x
- $hruid = strtolower(str_replace('@','.',$email).'.ext');
- // might already exists (in another group for example)
+ // User is of type xnet.
+ list($firstname, $lastname) = explode('@', $email);
+ $hruid = User::makeHrid($firstname, $lastname, 'ext');
+ // User might already have an account (in another group for example).
$user = User::get($hruid);
+
+ // If the user has no account yet, creates new account: build names from email address.
if (empty($user)) {
- // creates new account: build names from email address
$display_name = ucwords(strtolower(substr($hruid, strpos('.', $hruid))));
- $full_name = ucwords(strtolower(str_replace('.', ' ',substr($email, strpos('@', $email)))));
- XDB::execute("INSERT INTO accounts (hruid, display_name, full_name, email, type)
- VALUES({?}, {?}, {?}, {?}, 'xnet')",
- $hruid, $display_name, $full_name, $email);
+ $full_name = ucwords(strtolower(str_replace('.', ' ', substr($email, strpos('@', $email)))));
+ XDB::execute('INSERT INTO accounts (hruid, display_name, full_name, email, type)
+ VALUES ({?}, {?}, {?}, {?}, \'xnet\')',
+ $hruid, $display_name, $full_name, $email);
$user = User::get($hruid);
}
}
+
if ($user) {
- XDB::execute("REPLACE INTO group_members (uid, asso_id)
- VALUES ({?}, {?})",
+ XDB::execute('REPLACE INTO group_members (uid, asso_id)
+ VALUES ({?}, {?})',
$user->id(), $globals->asso('id'));
$this->removeSubscriptionRequest($user->id());
- pl_redirect("member/" . $user->login());
+ pl_redirect('member/' . $user->login());
}
}
}
}
if (empty($users)) {
- list($nom, $prenom) = str_replace(array('-', ' ', "'"), '%', array(Env::t('nom'), Env::t('prenom')));
+ list($lastname, $firstname) = str_replace(array('-', ' ', "'"), '%', array(Env::t('nom'), Env::t('prenom')));
$cond = new PFC_And(new PFC_Not(new UFC_Registered()));
- if (!empty($nom)) {
- $cond->addChild(new UFC_Name(Profile::LASTNAME, $nom, UFC_Name::CONTAINS));
+ if (!empty($lastname)) {
+ $cond->addChild(new UFC_Name(Profile::LASTNAME, $lastname, UFC_Name::CONTAINS));
}
- if (!empty($prenom)) {
- $cond->addChild(new UFC_Name(Profile::FIRSTNAME, $prenom, UFC_Name::CONTAINS));
+ if (!empty($firstname)) {
+ $cond->addChild(new UFC_Name(Profile::FIRSTNAME, $firstname, UFC_Name::CONTAINS));
}
- if (Env::i('promo')) {
- $cond->addChild(new UFC_Promo('=', UserFilter::GRADE_ING, Env::i('promo')));
+ if (Env::t('promo')) {
+ $cond->addChild(new UFC_Promo('=', UserFilter::DISPLAY, Env::t('promo')));
}
$uf = new UserFilter($cond);
$users = $uf->getUsers(new PlLimit(30));
private function changeLogin(PlPage &$page, PlUser &$user, MMList &$mmlist, $login)
{
- // Search the uid of the user...
+ // Search the user's uid.
$xuser = User::getSilent($login);
if (!$xuser) {
$accounts = User::getPendingAccounts($login);
return false;
}
$xuser = User::getSilent($accounts[0]['uid']);
- $sub = false;
}
if (!$xuser) {
return false;
}
- $user->mergeIn($xuser);
-
- return $xuser->login();
+ if ($user->mergeIn($xuser)) {
+ return $xuser->login();
+ }
+ return $user->login();
}
function handler_admin_member(&$page, $user)
$from_email = $user->forlifeEmail();
if (!$user->profile()) {
XDB::query('UPDATE accounts
- SET full_name = {?}, display_name = {?}, sex = {?}, email = {?}, type = {?}
+ SET full_name = {?}, directory_name = {?}, display_name = {?},
+ sex = {?}, email = {?}, type = {?}
WHERE uid = {?}',
- Post::v('full_name'), Post::v('display_name'), (Post::v('sex') == 'male')?'male':'female', Post::v('email'), (Post::v('type') == 'xnet')?'xnet':'virtual',
- $user->id());
- if (XDB::affectedRows()) {
- $page->trigSuccess('Données de l\'utilisateur mise à jour.');
- }
+ Post::t('full_name'), Post::t('directory_name'), Post::t('display_name'),
+ (Post::t('sex') == 'male') ? 'male' : 'female', Post::t('email'),
+ (Post::t('type') == 'xnet') ? 'xnet' : 'virtual', $user->id());
+ } else if (!$user->perms) {
+ XDB::query('UPDATE accounts
+ SET email = {?}
+ WHERE uid = {?}',
+ Post::t('email'), $user->id());
+ }
+ if (XDB::affectedRows()) {
+ $page->trigSuccess('Données de l\'utilisateur mise à jour.');
}
// Update group params for user
WHERE uid = {?} AND asso_id = {?}',
($perms == 'admin') ? 'admin' : 'membre', $comm,
$user->id(), $globals->asso('id'));
- if ($perms != $user->group_perms) {
- $page->trigSuccess('Permissions modifiées !');
- }
- if ($comm != $user->group_comm) {
- $page->trigSuccess('Commentaire mis à jour.');
+ if (XDB::affectedRows()) {
+ if ($perms != $user->group_perms) {
+ $page->trigSuccess('Permissions modifiées !');
+ }
+ if ($comm != $user->group_comm) {
+ $page->trigSuccess('Commentaire mis à jour.');
+ }
}
}
$user = User::getWithUID($user);
}
- $name = pl_entities($user->fullName());
+ $name = pl_entities($user->directoryName());
if ($with_sex && $user->isFemale()) {
$name = '•' . $name;
}
$name = '<a href="profile/' . $profile->hrid() . '" class="popup2">' . $name . '</a>';
}
}
+ if ($user->lost) {
+ $name .= ' <a href="https://www.polytechnique.org/marketing/broken/' . $user->hruid . '"><img src="images/icons/error.gif" alt="Patte cassée" /></a>';
+ }
if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin' && !empty($name)) {
$name = '<strong>' . $name . '</strong>';
}
global $globals;
$id = Cookie::i('uid', -1);
- $id = S::v($_SESSION['uid'], $id);
+ $id = S::v('uid', $id);
if ($id < 0) {
return '';
<td>
Promotion :
<input type="text" name="promo" value="{$promo}" size="5" maxlength="5" />
- <input type="submit" value="GO" />
+ <input type="submit" value="Afficher" />
</td>
</tr>
</table>
</form>
-{if t($decedes)}
+{if t($profileList)}
<form action="admin/deaths/{$promo}/validate" id="deathDateList" method="post">
{xsrf_token_field}
<table class="bicol" summary="liste des dates de décès">
<th>Nom</th>
<th>Date de décès</th>
</tr>
- {iterate item=x from=$decedes}
+ {iterate item=profile from=$profileList}
<tr class="{cycle values="impair,pair"}">
- <td>{$x.directory_name}</td>
+ <td>{$profile.directory_name}</td>
<td class="center">
- <input type="text" class="deathDate" name="death_{$x.pid}" value="{$x.deathdate}" size="10" maxlength="10" />
+ <input type="text" name="death_{$profile.pid}" value="{$profile.deathdate}" size="10" maxlength="10" />
</td>
</tr>
{/iterate}
</tr>
</table>
</form>
-
-<script type="text/javascript">//<![CDATA[
- {literal}
- $('input.deathDate').change(function () {
- $(this).addClass('sendDate');
- });
-
- $('#deathDateList').submit(function () {
- // Avoid sending useless data to the webserver
- $('input.deathDate').not('.sendDate').attr('disabled', true);
- });
- {/literal}
-//]]></script>
{/if}
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
|
<a href="admin/icons">Icônes</a>
|
- <a href="sql_errors">Erreurs MySQL</a>
+ <a href="site_errors">Erreurs d'exécution</a>
</td>
</tr>
<tr class="impair">
<td class="titre">Comptes</td>
<td>
+ <a href="admin/account/types">Types de comptes</a>
+ |
<a href="admin/add_accounts">Ajout de comptes</a>
|
<a href="admin/user">Édition</a>
<script type="text/javascript">
//<![CDATA[
-function doEditUser() {
- document.forms.auth.hashpass.value = hash_encrypt(document.forms.edit.password.value);
- document.forms.auth.password.value = "";
- document.forms.auth.submit();
-}
-
function del_alias(alias) {
document.forms.alias.del_alias.value = alias;
document.forms.alias.submit();
<tr>
<th colspan="2">
<div style="float: right; text-align: right">
+ {if $user->state eq 'pending'}
+ Non-inscrit
+ {else}
Inscrit le {$user->registration_date|date_format}
+ {/if}
</div>
<div style="float: left; text-align: left">
{icon name=user_gray} {$user->hruid} (uid {$user->id()})
</tr>
<tr>
<td class="titre">Nom complet</td>
- <td><input type="text" name="full_name" maxlength="255" value="{$user->fullName()}" /></td>
+ <td>{if $hasProfile}{$user->fullName()}{else}<input type="text" name="full_name" maxlength="255" value="{$user->fullName()}" />{/if}</td>
+ </tr>
+ <tr>
+ <td class="titre">Nom annuaire</td>
+ <td>{if $hasProfile}{$user->directoryName()}{else}<input type="text" name="directory_name" maxlength="255" value="{$user->directoryName()}" />{/if}</td>
</tr>
<tr>
<td class="titre">Nom affiché</td>
- <td><input type="text" name="display_name" maxlength="255" value="{$user->displayName()}" /></td>
+ <td>{if $hasProfile}{$user->displayName()}{else}<input type="text" name="display_name" maxlength="255" value="{$user->displayName()}" />{/if}</td>
</tr>
<tr>
<td class="titre">Sexe</td>
<td class="titre">Mot de passe</td>
<td>
<div style="float: left">
- <input type="text" name="newpass_clair" size="10" maxlength="256" value="********" />
- <input type="hidden" name="hashpass" value="" />
+ <input type="text" name="new_plain_password" size="10" maxlength="256" value="********" />
+ <input type="hidden" name="pwhash" value="" />
</div>
<div style="float: left; margin-top: 5px;">
- {checkpasswd prompt="newpass_clair" submit="dummy_none"}
+ {checkpasswd prompt="new_plain_password" submit="dummy_none"}
</div>
</td>
</tr>
</tr>
<tr class="impair">
<td colspan="2" class="center">
- {* TODO: on 'update_account', update the hashpass field before sending the form. *}
- <input type="submit" name="update_account" value="Mettre à jour" />
+ <input type="submit" name="update_account" value="Mettre à jour" onclick="return hashResponse('new_plain_password', false, false);" />
<input type="submit" name="su_account" value="Prendre l'identité" />
<input type="submit" name="log_account" value="Consulter les logs" />
</td>
{to addr=#to#}
{subject text="INTERVENTION de $admin"}
{elseif $mail_part eq 'wiki'}
-{if $deletion}
-L'utilisateur {$user} a été désinscrit de plat/al.
-{else}
-Le profil du camarade {$old.prenom} {$old.nom} ({$old.promo}) a été édité.\\
+
+Le compte de l'utilisateur {$hruid} a été édité.\\
Les champs suivants ont été changés :
-{foreach from=$old item=value key=field}
-{if $value neq $new[$field]}
-* '''{$field}''' : {$value} -> {$new[$field]}
-{/if}
+{foreach from=$diff item=values key=field}
+* '''{$field}''' : {$values.0} -> {$values.1}
{/foreach}
Et ceux qui n'ont pas changé :
-{foreach from=$old item=value key=field}
-{if $value eq $new[$field]}
+{foreach from=$oldValues item=value key=field}
* '''{$field}''' : {$value}
-{/if}
{/foreach}
{/if}
-{/if}
{* vim:set et sw=2 sts=2 sws=2: *}
<tr>
<td class="titre" style="width: 20%">Demandeur :</td>
<td>
- <a href="profile/{$valid->user->login()}" class="popup2">
- {$valid->user->fullName()} ({$valid->user->promo()})
+ {if $valid->user->hasProfile()}
+ {assign var="profile" value=$valid->user->profile()}
+ <a href="profile/{$profile->hrpid}" class="popup2">
+ {/if}
+ {$valid->user->fullName("promo")}
</a>
</td>
</tr>
- {if $valid->profile}
+ {if $valid->profile && !$valid->userIsProfileOwner}
<tr>
<td class="titre" style="width: 20%">Profil concerné :</td>
<td>
function toggle_folder() {
me = this;
if ($(this).attr("class") == "wiki_category")
- me = $("../img.wiki_root", me)[0];
+ me = $("../img.wiki_root", me)[0];
var cat=$.trim($(me).parent().text().replace(/(.*)\([0-9]+\)/, "$1"));
if ($(me).attr('src') == "images/k1.gif") {
- deplie(me, cat);
+ deplie(me, cat);
}
replie(me, cat);
setTimeout("toggle = 0;", 10);
{/literal}
<p class="center">
- <a href="Site/AllRecentChanges?action=rss&user={$smarty.session.hruid}&hash={$smarty.session.token}" style="display:block;float:right" title="Changements">{icon name=feed title='fil rss'}</a>
+ <a href="Site/AllRecentChanges?action=rss&user={$smarty.session.hruid}&hash={$smarty.session.user->token}" style="display:block;float:right" title="Changements">{icon name=feed title='fil rss'}</a>
{icon name=magnifier} <a href="Site/AllRecentChanges">Voir les changements récents</a>
</p>
{if $is_mail}
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
<title>Lettre d'information de l'AX</title>
<style type="text/css">
{literal}
Votre désinscription aux envois exceptionnels de l'AX a été réalisée avec
succès. Si vous désirez vous réinscrire, merci de contacter
<a href="mailto:info@amicale.polytechnique.org">l'AX</a>. Vous pouvez également
- le faire en vous <a href="register">inscrivant à Polytechnique.org</a> (pour
+ le faire en vous <a href="register">inscrivant à Polytechnique.org</a> (pour
les X uniquement).
</p>
{else}
<table class="bicol">
<tr>
<th colspan="2">
- {if $smarty.session.token}
- <a href="carnet/rss/{$smarty.session.hruid}/{$smarty.session.token}/rss.xml" style="display:block;float:right" title="Notifications">
+ {if $smarty.session.user->token}
+ <a href="carnet/rss/{$smarty.session.hruid}/{$smarty.session.user->token}/rss.xml" style="display:block;float:right" title="Notifications">
{icon name=feed title='fil rss'}
</a>
{else}
</li>
<li>
Le calendrier des anniversaires :
- <a href="carnet/contacts/ical/{$smarty.session.hruid}/{$smarty.session.token}/anniv-x.ics">
+ <a href="carnet/contacts/ical/{$smarty.session.hruid}/{$smarty.session.user->token}/anniv-x.ics">
{icon name=calendar_view_day title='Anniversaires au format iCal'}
</a>
- <a href="carnet/contacts/csv/birthday/{$smarty.session.hruid}/{$smarty.session.token}/anniv-x.csv">
+ <a href="carnet/contacts/csv/birthday/{$smarty.session.hruid}/{$smarty.session.user->token}/anniv-x.csv">
{icon name=outlook title='Anniversaires au format Outlook'}
</a>
</li>
{icon name=vcard title='Carte de visite au format vCard'}
</a>
(<a href="carnet/contacts/vcard/MesContactsXorg.vcf">sans les photos</a>)
- <a href="carnet/contacts/csv/{$smarty.session.hruid}/{$smarty.session.token}/MesContactsXorg.csv">
+ <a href="carnet/contacts/csv/{$smarty.session.hruid}/{$smarty.session.user->token}/MesContactsXorg.csv">
{icon name=outlook title='Contacts au format Outlook'}
</a>
</li>
</p>
<div class="right">
-{if $smarty.session.token}
-<a href="carnet/rss/{$smarty.session.hruid}/{$smarty.session.token}/rss.xml" title="Notifications">{icon name=feed title='fil rss'}</a>
+{if $smarty.session.user->token}
+<a href="carnet/rss/{$smarty.session.hruid}/{$smarty.session.user->token}/rss.xml" title="Notifications">{icon name=feed title='fil rss'}</a>
{/if}
</div>
{* *}
{**************************************************************************}
-{if $referer || $platal->pl_self() neq 'login'}
+{if t($referer) || $platal->pl_self() neq 'login'}
<h1>
Accès restreint
</h1>
<td>
<input type="text" name="username" size="20" maxlength="50" value="{insert name="getUserName"}" /> @ <select name="domain">
<option value="login">{#globals.mail.domain#} / {#globals.mail.domain2#}</option>
- <option value="alias" {if $smarty.cookies.ORGdomain eq alias}selected="selected"{/if}>
+ <option value="alias" {if t($smarty.cookies.ORGdomain) eq "alias"}selected="selected"{/if}>
{#globals.mail.alias_dom#} / {#globals.mail.alias_dom2#}
</option>
</select>
en clair entre chez toi et Polytechnique.org, ce qui assure une confidentialité maximale.
{else}
{icon name=lock_open} Tu utilises actuellement une connexion HTTP non sécurisée. Toutes les informations
- (<strong>excepté le mot de passe de connexion au site</strong>) circulent en clair entre chez toi et
+ (<strong>excepté le mot de passe de connexion au site</strong>) circulent en clair entre chez toi et
Polytechnique.org. Tu peux basculer sur une connexion sécurisée en cliquant sur le lien
<div class="center">
<a href="https://{#globals.core.secure_domain#}{$smarty.server.REQUEST_URI}">
<h2>Patte cassée</h2>
<p>
Désolé, mais ton correspondant, {$x.user->fullName()},
- n'a actuellement <span class="erreur">aucune adresse email de redirection
+ n'a actuellement <span class="erreur">aucune adresse email de redirection
active autre que celle que tu viens de rentrer.</span>
Nous t'invitons à prendre contact avec lui autrement que par email,
l'idéal étant de l'informer si possible que sa patte Polytechnique.org est cassée !
{if $ok}
<p>
- {if $sexe}Chère{else}Cher{/if} {$prenom},
+ {if $sexe}Chère{else}Cher{/if} {$yourself},
</p>
<p>
<h1>Perdus de vue</h1>
-<p>Ces {$lost_emails->total()} camarades n'ont pas ou plus d'adresse email valides</p>
+<p>Ces {$lost_emails->total()} camarades n'ont pas ou plus d'adresse email valides.</p>
<table class="bicol">
<tr>
- <th>Utilisateur</th>
+ <th colspan="2">Utilisateur</th>
</tr>
+ {assign var="promo" value=""}
{iterate from=$lost_emails item="looser"}
<tr class="{cycle values="pair,impair"}">
+ <td>{if $promo neq $looser.promo}{assign var="promo" value=$looser.promo}{$promo}{/if}</td>
<td>
<a href="profile/{$looser.hruid}" class="popup2">{$looser.hruid}</a>
</td>
<form action="emails/send" method="post" enctype="multipart/form-data" id="form_mail" onsubmit="return check(this);">
{xsrf_token_field}
<table class="bicol" cellpadding="2" cellspacing="0">
- <tr>
+ <tr>
<th colspan="2">Destinataires</th>
</tr>
- <tr>
+ <tr>
<td class="titre">de :</td>
<td>
<input type='hidden' name='signature' value='1' />
{/if}' />
</td>
</tr>
- <tr>
+ <tr>
<td class="titre">à :</td>
<td>
<input type='text' name='to' size='60' value="{$smarty.request.to}" />
</td>
</tr>
- <tr>
+ <tr>
<td class="titre">copie :</td>
<td>
<input type='text' name='cc' size='60' value="{$smarty.request.cc}" />
</td>
</tr>
- <tr>
+ <tr>
<td class="titre">copie cachée :</td>
<td>
<input type='text' name='bcc' size='60' value="{$smarty.request.bcc}" />
<div style="float: right; width: 40%;">
<select id="to_contacts" name="to_contacts[]" multiple="multiple" style="width: 100%; height: 5em">
{foreach key=key item=contact from=$contacts}
- {if in_array($contact->hrpid,$smarty.request.to_contacts)}
+ {if t($smarty.request.to_contacts) && in_array($contact->hrpid,$smarty.request.to_contacts)}
<option value="{$contact->hrpid}">
{$contact->full_name}
</option>
<br />
<select id="cc_contacts" name="cc_contacts[]" multiple="multiple" style="width: 100%; height: 5em">
{foreach key=key item=contact from=$contacts}
- {if in_array($contact->hrpid,$smarty.request.cc_contacts)}
+ {if t($smarty.request.cc_contacts) && in_array($contact->hrpid,$smarty.request.cc_contacts)}
<option value="{$contact->hrpid}">
{$contact->full_name}
</option>
<div style="float: right; width: 40%">
<select id="contacts" name="all_contacts[]" multiple="multiple" style="height: 10em; width: 100%">
{foreach item=contact from=$contacts}
- {if !in_array($contact->hrpid,$smarty.request.to_contacts) && !in_array($contact->hrpid,$smarty.request.cc_contacts)}
+ {if !(isset($smarty.request.to_contacts|smarty:nodefaults) && isset($smarty.request.cc_contacts|smarty:nodefaults)) ||
+ (!in_array($contact->hrpid,$smarty.request.to_contacts) && !in_array($contact->hrpid,$smarty.request.cc_contacts))}
<option value="{$contact->hrpid}">
{$contact->full_name}
</option>
{else}
<h1 id='pagetop'>
-Bienvenue {$smarty.session.display_name}{if $birthday}
+Bienvenue {$smarty.session.user->displayName()}{if $birthday}
et joyeux anniversaire de la part de toute l'équipe !
{else},
{/if}
</h1>
-{if $smarty.session.host}
+{if $smarty.session.user->host}
<div class="smaller">
{if $birthday}T{else}t{/if}a connexion précédente date du
- <strong>{$smarty.session.lastlogin|date_format:"%x, %X"}</strong>
- depuis la machine <strong>{$smarty.session.host}</strong>.
+ <strong>{$smarty.session.user->lastlogin|date_format:"%x, %X"}</strong>
+ depuis la machine <strong>{$smarty.session.user->host}</strong>.
</div>
{/if}
<tr class="pair" style="height: 18px">
<td class="half titre" style="height: 18px; padding-top: 1px; padding-bottom: 1px;">
{if $smarty.foreach.events.first}
- {if $smarty.session.token}
- <a href="rss/{$smarty.session.hruid}/{$smarty.session.token}/rss.xml" style="display:block;float:right" title="Annonces">
+ {if $smarty.session.user->token}
+ <a href="rss/{$smarty.session.hruid}/{$smarty.session.user->token}/rss.xml" style="display:block;float:right" title="Annonces">
{icon name=feed title='fil rss'}
</a>
{else}
{if !$has_evts}
<tr>
<td class="half">
- {if $smarty.session.token}
- <a href="rss/{$smarty.session.hruid}/{$smarty.session.token}/rss.xml" style="display:block;float:right" title="Annonces">
+ {if $smarty.session.user->token}
+ <a href="rss/{$smarty.session.hruid}/{$smarty.session.user->token}/rss.xml" style="display:block;float:right" title="Annonces">
{icon name=feed title='fil rss'}
</a>
{else}
{literal}
<script type="text/javascript">
- $('#body td table tr').each(function() {
+ $('#body td table tr').each(function() {
var uidcell = $('td:eq(3)',this);
if (uidcell.length != 1) {
return;
$('#fusion-reload a').click(function(a) {
document.location = a.currentTarget.href;
document.location.reload();
- });
+ });
});
return false;
});
});
//-->
{/literal}
-</script>
+</script>
<h2><a href="fusionax">Fusion des annuaires X.org - AX</a></h2>
<h2>Import de l'annuaire AX</h2>
<h2>Fusion des annuaires X.org - AX</h2>
<ul>
<li>Voir la <a href="Fusion">documentation</a></li>
-<li><a href="fusionax/import">Import de la base AX</a> {if $lastimport} - (dernier import le {$lastimport}){/if}</li>
+<li><a href="fusionax/import">Import de la base AX</a> {if $lastimport} - (dernier import le {$lastimport}){/if}</li>
<li>Mise en <a href="fusionax/ids">correspondance simple</a></li>
<li>Création des <a href="fusionax/view">VIEW annexes nécessaires aux corrélations</a></li>
<li>Corrélation des <a href="fusionax/deceased">dates de décès</a></li>
{if !$dead && $registered}</a>{/if}
</div>
<div class="autre">
- {foreach from=$profile->nationalities() item=nat}
- <img src='images/flags/{$nat}.gif' alt='{$nat}' height='11' title='{$nat}' />
+ {foreach from=$profile->nationalities() item=country key=code}
+ <img src='images/flags/{$code}.gif' alt='{$code}' height='11' title='{$country}' />
{/foreach}
{$profile->promo()}{*
*}{if $dead}, {"décédé"|sex:"décédée":$profile} le {$profile->deathdate|date_format}{/if}
</tr>
<tr class="impair">
<td colspan="2">
- <form action="#" method="post" id="changepass">
+ <form action="#" method="post">
<table class="tinybicol">
<tr>
<td class="titre">Nouveau mot de passe</td>
- <td><input type="password" name="nouveau" onfocus="document.forms.changepass2.password_sync[1].checked = true;" /></td>
+ <td><input type="password" name="new1" onfocus="document.forms.changepass2.password_sync[1].checked = true;" /></td>
</tr>
<tr>
<td class="titre">Vérification</td>
- <td><input type="password" name="nouveau2" onfocus="document.forms.changepass2.password_sync[1].checked = true;" /></td>
+ <td><input type="password" name="new2" onfocus="document.forms.changepass2.password_sync[1].checked = true;" /></td>
</tr>
<tr>
<td class="titre">Sécurité</td>
- <td>{checkpasswd prompt="nouveau" submit="create_account" text="Créer mon compte !"}</td>
+ <td>{checkpasswd prompt="new" submit="create_account" text="Créer mon compte !"}</td>
</tr>
</table>
</form>
{if $password_sync}
<input type="submit" value="Créer mon compte !" />
{else}
- <input type="hidden" name="response2" value="" />
- <input type="submit" name="create_account" value="Créer mon compte !" onclick="EnCryptedResponse(); return false;" />
+ <input type="hidden" name="pwhash" value="" />
+ <input type="submit" name="create_account" value="Créer mon compte !" onclick="return hashResponse('new1', 'new2', true);" />
{/if}
</td>
</tr>
{else}
<tr class="impair"><td colspan="2">
Changer le mot de passe de ton compte Google Apps :<br /><br />
- <form action="googleapps/password" method="post" id="changepass">
+ <form action="googleapps/password" method="post">
+ {xsrf_token_field}
<table class="bicol">
<tr>
<td class="titre">Nouveau mot de passe</td>
- <td><input type="password" name="nouveau" /></td>
+ <td><input type="password" name="new1" /></td>
</tr>
<tr>
<td class="titre">Vérification</td>
- <td><input type="password" name="nouveau2" /></td>
+ <td><input type="password" name="new2" /></td>
</tr>
<tr>
<td class="titre">Sécurité</td>
- <td>{checkpasswd prompt="nouveau" submit="create_account" text="Changer mon mot de passe"}</td>
+ <td>{checkpasswd prompt="new1" submit="create_account" text="Changer mon mot de passe"}</td>
</tr>
<tr>
<td></td>
- <td><input type="submit" name="create_account" value="Changer" onclick="EnCryptedResponse(); return false;" /></td>
+ <td>
+ <input type="hidden" name="pwhash" value="" />
+ <input type="submit" name="create_account" value="Changer" onclick="return hashResponse('new1', 'new2', true);" />
+ </td>
</tr>
</table>
</form>
- <form action="googleapps/password" method="post" id="changepass2">
- {xsrf_token_field}
- <input type="hidden" name="response2" value="" />
- </form><br />
+ <br />
Pour une sécurité optimale, ton mot de passe circule de manière sécurisée (https).
Il est chiffré irréversiblement sur nos serveurs, ainsi que sur ceux de Google.
</td></tr>
range.innerHTML = "L\'annonce est destinée à la promotion " + min + ".";
} else {
range.innerHTML = "L\'annonce est destinée aux promotions de " + min + " à " + max + ' (incluses).';
- }
+ }
return true;
- }
+ }
{/literal}
//]]></script>
<input type="text" name="{$min_field_name|default:"promo_min"}" id="{$prefix}promo_min"
<strong>Site web :</strong>
<input type="text" name="url" size="25" maxlength="200" value="{$valid->url}" /><br />
<strong>Email :</strong>
-<input type="text" name="url" size="25" maxlength="200" value="{$valid->email}" /><br />
+<input type="text" name="email" size="25" maxlength="200" value="{$valid->email}" /><br />
<strong>Holding :</strong>
<input type="text" name="holdingid" size="25" maxlength="200" value="{$valid->holdingid}" /><br />
<strong>Code NAF :</strong>
<strong>Code AX :</strong>
<input type="text" name="AX_code" size="25" maxlength="200" value="{$valid->AX_code}" /><br />
<strong>Adresse :</strong>
-<textarea cols="30" rows="4" name="address">{$valid->address['text']}</textarea><br />
+<textarea cols="30" rows="4" name="address">{$valid->address.text}</textarea><br />
<strong>Téléphone :</strong>
<input type="text" name="tel" size="25" maxlength="200" value="{$valid->tel}" /><br />
<strong>Fax :</strong>
<input type="submit" name="preview" value="Aperçu" onclick="previewWiki('msg_{$valid->id()}', 'preview_{$valid->id()}', true, 'preview_{$valid->id()}'); return false;" /><br />
<strong>Site :</strong> <input type="text" name="pay_site" size="45" value="{$valid->site}" />
<br>
-<strong>Montant :</strong> <input type="text" name="pay_montant" size="5" value="{$valid->montant}" />
+<strong>Montant :</strong> <input type="text" name="pay_montant" size="5" value="{$valid->montant}" />
(min <input type="text" name="pay_montant_min" size="5" value="{$valid->montant_min}" />
-> max <input type="text" name="pay_montant_max" size="5" value="{$valid->montant_max}" />)
</tr>
<tr class="pair">
<td class="titre">Adresse :</td>
- <td>{$valid->address[text]}</td>
+ <td>{$valid->address.text}</td>
</tr>
<tr class="pair">
<td class="titre">Téléphone :</td>
<div class="nom">
{if $profile->isFemale()}•{/if}
{if !$dead && $registered}<a href="profile/{$profile->hrid()}" class="popup2">{/if}
- {$profile->full_name}
+ {$profile->directory_name}
{if !$dead && $registered}</a>{/if}
</div>
<div class="edu">
- {foreach from=$profile->nationalities() item=nat}
- <img src='images/flags/{$nat}.gif' alt='{$nat}' height='11' title='{$nat}' />
+ {foreach from=$profile->nationalities() item=country key=code}
+ <img src='images/flags/{$code}.gif' alt='{$code}' height='11' title='{$country}' />
{/foreach}
{$profile->promo()}{*
*}{foreach from=$profile->getExtraEducations(4) item=edu}, {display_education edu=$edu profile=$profile}{/foreach}{*
{else}
<td class="center" style="vertical-align: bottom; padding-bottom: 15px">
<a href="profile/{$profile->hrid()}" class="popup2">
- <span {if $profile->name_tooltip}class="hinted"
- title="{$profile->directory_name}"{/if}>{$profile->directory_name}</span>
- {if $trombi_with_promo && $profile->promo()}({$profile->promo()}){/if}
+ {$profile->private_name} {if $trombi_with_promo && $profile->promo()}({$profile->promo()}){/if}
</a>
</td>
{/if}
-- <br />
l'équipe de Polytechnique.org<br />
Le portail des élèves & anciens élèves de l'École polytechnique
-{/if}
+{elseif $mail_part eq "escaped_html"}Cordialement,<br />-- <br />l'équipe de Polytechnique.org<br />Le portail des élèves & anciens élèves de l'École polytechnique{/if}
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
{* *}
{**************************************************************************}
-
+
<table cellpadding="8" cellspacing="2" style="width:100%;">
{foreach from=$trombi_list item=p}
{cycle values="1,2,3" assign="loop"}
{/if}
<br />
<a href="{if $urlmainsite}{$urlmainsite}{/if}profile/{$p.forlife}" class="popup2">
- <span {if $p.name_tooltip}class="hinted" title="{$p.name_tooltip}"{/if}>{$p.name_display}</span>{if $trombi_show_promo} ({$p.promo_display}){/if}
+ {$p.name_display}{if $trombi_show_promo} ({$p.promo_display}){/if}
</a>
</td>
{if $loop eq "3"}
<tr>
<td><strong>Liste {$platal->argv[1]} :</strong></td>
<td>
- {if $on neq members}
+ {if $on neq 'members'}
[<a href='{$platal->ns}lists/members/{$platal->argv[1]}'>liste des membres</a>]
{else}
[liste des membres]
{/if}
- {if $on neq trombi}
+ {if $on neq 'trombi'}
[<a href='{$platal->ns}lists/annu/{$platal->argv[1]}'>annuaire/trombi</a>]
{else}
[annuaire/trombi]
{/if}
- {if $on neq archives}
+ {if $on neq 'archives'}
[<a href='{$platal->ns}lists/archives/{$platal->argv[1]}'>archives</a>]
{else}
[archives]
<tr>
<td><strong>Administrer la liste :</strong></td>
<td>
- {if $on neq moderate}
+ {if $on neq 'moderate'}
[<a href='{$platal->ns}lists/moderate/{$platal->argv[1]}'>modération</a>]
{else}
[modération]
{/if}
- {if $on neq admin}
+ {if $on neq 'admin'}
[<a href='{$platal->ns}lists/admin/{$platal->argv[1]}'>ajout/retrait de membres</a>]
{else}
[ajout/retrait de membres]
{/if}
- {if $on neq options}
+ {if $on neq 'options'}
[<a href='{$platal->ns}lists/options/{$platal->argv[1]}'>options</a>]
{else}
[options]
{/if}
- {if $on neq delete}
+ {if $on neq 'delete'}
[<a href='{$platal->ns}lists/delete/{$platal->argv[1]}'>détruire</a>]
{else}
[détruire liste]
<tr>
<td><strong>Administrer (avancé) :</strong></td>
<td>
- {if $on neq soptions}
+ {if $on neq 'soptions'}
[<a href='{$platal->ns}lists/soptions/{$platal->argv[1]}'>options avancées</a>]
{else}
[options avancées]
{/if}
- {if $on neq check}
+ {if $on neq 'check'}
[<a href='{$platal->ns}lists/check/{$platal->argv[1]}'>vérifications</a>]
{else}
[vérifications]
{if $it_is_xnet && ($details.own || $is_admin)}
<tr>
<td><strong>Synchroniser :</strong></td>
- {if $on neq sync}
+ {if $on neq 'sync'}
<td>[<a href="{$platal->ns}lists/sync/{$platal->argv[1]}">synchroniser avec l'annuaire</a>]</td>
{else}
<td>[synchroniser avec l'annuaire]</td>
<ul>
<li>Pour demander ton inscription à une liste de diffusion, il suffit
de cliquer sur l'icône {icon name=add} située en fin de ligne.</li>
- <li>Si la liste est à inscription modérée, l'icône {icon name=flag_orange title="en cours"}
+ <li>Si la liste est à inscription modérée, l'icône {icon name=flag_orange title="en cours"}
apparaîtra tant que ton inscription n'aura pas été validée par un modérateur.</li>
<li>Pour te désinscrire d'une liste dont tu es membre, il suffit de cliquer sur la croix
{icon name=cross title="désinscription"} située en fin de ligne.</li>
{/if}
</td>
<td>
- <a href='{$platal->ns}lists/members/{$liste.list}'>{$liste.list}</a>
+ <a href='{$platal->ns}lists/members/{$liste.list}'>{$liste.list}</a>
</td>
<td>
{$liste.desc|smarty:nodefaults}<br/>
</tr>
- {foreach from=$members item=xs key=promo}
- {foreach from=$xs item=x name=all}
+ {assign var=lostUsers value=false}
+ {foreach from=$members item=users key=promo}
+ {foreach from=$users item=user name=all}
<tr>
<td class='titre' style="width: 20%">
{if $smarty.foreach.all.first}
{/if}
</td>
<td>
- {if $promo && strpos($x.l, '@') === false}
- {if $x.b}<a href="https://www.polytechnique.org/marketing/broken/{$x.l}">{icon name=error}</a>{/if}
- <a href="profile/{$x.l}" class="popup2">{$x.n}</a>
- {elseif $x.x}
- <a href="{$platal->ns}member/{$x.x}">{if $x.n|trim}{$x.n}{else}{$x.l}{/if}</a>
- {elseif $x.n}
- {$x.n}
+ {if $promo && $user.x}
+ {if $user.b}{assign var=lostUsers value=true}{/if}
+ {profile user=$user.x promo=false}
+ {elseif $user.x}
+ <a href="{$platal->ns}member/{$user.x}">{if $user.n|trim}{$x.n}{else}{$user.l}{/if}</a>
+ {elseif $user.n}
+ {$user.n}
{else}
- {$x.l}
+ {$user.l}
{/if}
</td>
- {if $x.p}
+ {if $user.p}
<td class="right">
- {$x.p}
+ {$user.p}
</td>
{/if}
</tr>
{/foreach}
{/foreach}
</table>
+
+{if $lostUsers}
+<p class="smaller">
+ {icon name=error} Un camarade signalé par ce symbole n'a plus d'adresse de redirection et ne peut donc
+ plus être contacté via son adresse polytechnique.org. Si tu connais sa nouvelle adresse, tu peux nous la communiquer en
+ cliquant sur le symbole.
+</p>
+{/if}
+
{/if}
if (event.target.tagName === 'INPUT') {
return;
}
-
+
var checkbox = $(this).parent().find(':checkbox');
-
+
checkbox = checkbox.attr('checked', !checkbox.attr('checked'));
-
+
event.stopPropagation();
});
{/literal}
<input type='hidden' name='mid' value='{$smarty.get.mid}' />
<input type='submit' name='mok' value='Accepter !'
onclick="return confirm('Es-tu sûr de vouloir Envoyer cet email sur la liste ?')"/>
- <input type='submit' name='mno' value='Refuser !'
+ <input type='submit' name='mno' value='Refuser !'
onclick="return confirm('Es-tu sûr de vouloir Refuser cet email ?')"/>
<input type='submit' name='mdel' value='Spam !' style='color:red;'
onclick="return confirm('Es-tu sûr de vouloir Détruire cet email ?')"/>
{elseif $user && !$user->alive}
<p class="erreur">
- {$user->fullName()} (X{$user->promo()}) est malheureusement décédé{if $user->isFemale()}e{/if}.
+ {$user->fullName("promo")} est malheureusement décédé{if $user->isFemale()}e{/if}.
Nous ne réaliserons maintenance sur son adresse Polytechnique.org qu'à la demande explicite
de sa famille. Pour tout renseignement, merci de <a href="mailto:contact@polytechnique.org">
contacter le support</a>.
{elseif $user}
<h1>
- Recherche d'adresses pour {$user->fullName()} (X{$user->promo()}).
+ Recherche d'adresses pour {$user->fullName("promo")}.
</h1>
{if !$user->email}
{elseif $user->last}
<p>
{$user->fullName()} a encore des adresses de redirection actives malgré des pannes détectées sur certaines d'entre elles. Si
- tu es sûr{if $smarty.session.femme}e{/if} que son adresse Polytechnique.org est en panne, tu peux proposer une nouvelle
+ tu es sûr{if $smarty.session.user->gender}e{/if} que son adresse Polytechnique.org est en panne, tu peux proposer une nouvelle
adresse email à ajouter à ses redirections. Merci d'ajouter un commentaire pour nous indiquer la raison de cette proposition.
</p>
{else}
<p>
- Nous n'avons actuellement enregistré aucune panne sur les adresses de redirection de {$user->fullName()}. Si tu es
- sûr{if $smarty.session.femme}e{/if} que son adresse de redirection actuelle est en panne, tu peux nous proposer
+ Nous n'avons actuellement enregistré aucune panne sur les adresses de redirection de {$user->fullName()}. Si tu es
+ sûr{if $smarty.session.user->gender}e{/if} que son adresse de redirection actuelle est en panne, tu peux nous proposer
une nouvelle adresse, accompagnée d'un commentaire nous expliquant les raisons exactes de cette proposition.
</p>
{/if}
<form method="post" action="{$platal->path}">
{xsrf_token_field}
<table class="bicol" summary="Fiche camarade">
- <tr><th colspan="2">Proposition d'adresse pour<br />{$user->fullName()} (X{$user->promo()})</th></tr>
+ <tr><th colspan="2">Proposition d'adresse pour<br />{$user->fullName("promo")}</th></tr>
<tr class="pair">
<td>Adresse email :</td>
<td>
<br />
<p>
-Nombre d'X vivants d'après notre base de données : {$stats.vivants}<br />
-Nombre d'X vivants inscrits à Polytechnique.org : {$stats.inscrits}<br />
-Soit un pourcentage d'inscrits de : {$stats.ins_rate} %<br />
+nombre d'X vivants d'après notre base de données : {$statistics.alive}<br />
+nombre d'X vivants inscrits à Polytechnique.org : {$statistics.registered}<br />
+Soit un pourcentage d'inscrits de : {$statistics.registeredRate} %<br />
</p>
<p>
Parmi ceux-ci :<br />
-Nombre d'X vivants depuis 1972 d'après notre base de données : {$stats.vivants72}<br />
-Nombre d'X vivants depuis 1972 inscrits à Polytechnique.org : {$stats.inscrits72}<br />
-Soit un pourcentage d'inscrits de : {$stats.ins72_rate} %<br />
+nombre d'X vivants depuis 1972 d'après notre base de données : {$statistics.alive72}<br />
+nombre d'X vivants depuis 1972 inscrits à Polytechnique.org : {$statistics.registered72}<br />
+Soit un pourcentage d'inscrits de : {$statistics.registeredRate72} %<br />
</p>
<p>
-Nombre de Polytechniciennes vivantes : {$stats.vivantes}<br />
-Nombre de Polytechniciennes vivantes et inscrites : {$stats.inscrites}<br />
-Soit un pourcentage d'inscrites de : {$stats.inse_rate} %<br />
+nombre de Polytechniciennes vivantes : {$statistics.womenAlive}<br />
+nombre de Polytechniciennes vivantes et inscrites : {$statistics.womenRegistered}<br />
+Soit un pourcentage d'inscrites de : {$statistics.womenRegisteredRate} %<br />
</p>
<p>
-Nombre d'<a href="marketing/this_week">inscrits ces 7 derniers jours</a> : {$nbInsSem}<br />
-Nombre d'<a href="marketing/relance">inscriptions en cours</a> (2ème phase non terminée) : {$nbInsEnCours}
+nombre d'<a href="marketing/this_week">inscrits ces 7 derniers jours</a> : {$registrations.week}<br />
+nombre d'<a href="marketing/relance">inscriptions en cours</a> (2ème phase non terminée) : {$registrations.pending}
</p>
<table class="bicol">
</tr>
<tr>
<td> </td>
- <td class="titre">Abouti</td>
<td class="titre">Non abouti</td>
+ <td class="titre">Abouti</td>
<td class="titre">Total</td>
</tr>
<tr>
<td>Personnel</td>
- <td>{$nbInsMarketOkPerso}</td>
- <td>{$nbInsMarketNoPerso}</td>
- <td>{$nbInsMarketOkPerso+$nbInsMarketNoPerso}</td>
+ <td>{$marketings.noPerso}</td>
+ <td rowspan="3" style="vertical-align: middle">{$marketings.ok}</td>
+ <td rowspan="3" style="vertical-align: middle">{$marketings.ok+$marketings.noPerso+$marketings.noXorg+$marketings.noAX}</td>
</tr>
<tr>
<td>Par Polytechnique.org</td>
- <td>{$nbInsMarketOkXorg}</td>
- <td>{$nbInsMarketNoXorg}</td>
- <td>{$nbInsMarketOkXorg+$nbInsMarketNoXorg}</td>
+ <td>{$marketings.noXorg}</td>
+ </tr>
+ <tr>
+ <td>Par l'AX</td>
+ <td>{$marketings.noAX}</td>
</tr>
<tr>
<td>Cette semaine</td>
- <td>{$nbInsMarketOkWeek}</td>
- <td>{$nbInsMarketNoWeek}</td>
- <td>{$nbInsMarketOkWeek+$nbInsMarketNoWeek}</td>
+ <td>{$marketings.noWeek}</td>
+ <td>{$marketings.okWeek}</td>
+ <td>{$marketings.okWeek+$marketings.noWeek}</td>
</tr>
<tr>
<td class="titre">Total</td>
- <td>{$nbInsMarketOkPerso+$nbInsMarketOkXorg}</td>
- <td>{$nbInsMarketNoPerso+$nbInsMarketNoXorg}</td>
- <td>{$nbInsMarketOkPerso+$nbInsMarketOkXorg+$nbInsMarketNoPerso+$nbInsMarketNoXorg}</td>
+ <td>{$marketings.noPerso+$marketings.noXorg+$marketings.noAX}</td>
+ <td>{$marketings.ok}</td>
+ <td>{$marketings.ok+$marketings.noPerso+$marketings.noXorg+$marketings.noAX}</td>
</tr>
</table>
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
+
{#globals.baseurl#}/register/%%hash%%
==========================================================
-Il ne te faut que 5 minutes sur https://www.polytechnique.org/ pour rejoindre la communauté polytechnicienne sur le web grâce aux services de Polytechnique.org dont profitent déjà {$num_users} camarades. Cela te permettra, entre autres, de contacter un X en connaissant seulement son nom et son prénom et de bénéficier à vie d'une adresse prestigieuse {$u.forlife_email} et de son alias discret {$u.forlife_email2} (m4x = mail for X).
+Il ne te faut que 5 minutes sur https://www.polytechnique.org/ pour rejoindre la communauté polytechnicienne sur le web grâce aux services de Polytechnique.org dont profitent déjà {$globals->core->NbIns|number_format} camarades. Cela te permettra, entre autres, de contacter un X en connaissant seulement son nom et son prénom et de bénéficier à vie d'une adresse prestigieuse {$u.forlife_email} et de son alias discret {$u.forlife_email2} (m4x = mail for X).
Pas de nouvelle boîte aux lettres à relever, il suffit de la rediriger vers ton adresse personnelle et/ou professionnelle que tu indiques et que tu peux changer à ta guise, sans que tes correspondants n'aient à actualiser leur carnet d'adresses.
{$personal_notes}
À bientôt sur Polytechnique.org <https://www.polytechnique.org>,
-Bien cordialement,
---
{$sign}
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
<td>{profile user=$it}</td>
<td>{if $it->lastKnownEmail()}{mailto address=$it->lastKnownEmail()}{/if}</td>
<td class="center">
- {if $it->lastMarketingRelance() && $it->lastMarketingRelance() != '0000-00-00'}
- Relance le : {$it->lastMarketingRelance()}
- {elseif $it->lastKnownEmail()}
- En cours : {$it->lastKnownEmail()}
+ {if $it->pendingRegistrationDate() > $it->lastMarketingDate()}
+ En cours : {$it->pendingRegistrationEmail()}
+ {elseif $it->lastMarketingDate() && $it->lastMarketingDate() != '0000-00-00'}
+ Relance le : {$it->lastMarketingDate()}
{else}
-
{/if}
</label><br />
<label>
<input type="radio" name="origine" value="staff"
- onclick='$("#sender").html("{$xorg_signature}"); $("#tr_perso").hide();
- $("#personal_notes_display").hide();' />
+ onclick='$("#sender").html("{include file=include/signature.mail.tpl mail_part=$mail_part}");
+ $("#tr_perso").hide(); $("#personal_notes_display").hide();' />
au nom de l'équipe Polytechnique.org
</label>
</td>
<h1>
-{if $actif}Modification du mot de passe SMTP/NNTP{else}Activation de ton compte SMTP/NNTP{/if}
+{if $actif}Modification du mot de passe SMTP/NNTP{else}Activation de ton compte SMTP/NNTP{/if}
</h1>
{literal}
<p>
{icon name=error title="Attention"} Nous te déconseillons fortement d'utiliser le même
mot de passe que pour la connexion au site. En effet, ce mot de passe sert à accéder à des
- services <em>moins</em> sécurisés, ce qui nécessite son enregistrement en clair dans
+ services <em>moins</em> sécurisés, ce qui nécessite son enregistrement en clair dans
notre base de données.
</p>
</p>
{include wiki=Xorg.NNTPSecurise}
{elseif $smarty.request.doc eq "smtp"}
-<p>
+<p>
<a href="{$platal->pl_self()}?doc=nntp">Pourquoi et comment</a> utiliser le serveur NNTP de {#globals.core.sitename#}.<br />
</p>
{include wiki=Xorg.SMTPSecurise}
<h1>Fil RSS</h1>
-{if !$smarty.session.token}
+{if !$smarty.session.user->token}
<p>
Tu viens de cliquer sur le lien d'activation des fils RSS. Les fils RSS du site
ne sont pas activés dans tes préférences.
<ul>
<li>
Anonces sur la page d'entrée :
- <a href="rss/{$smarty.session.hruid}/{$smarty.session.token}/rss.xml" title="Annonces">{icon name=feed title='fil rss'}</a>
+ <a href="rss/{$smarty.session.hruid}/{$smarty.session.user->token}/rss.xml" title="Annonces">{icon name=feed title='fil rss'}</a>
</li>
<li>
Ton carnet polytechnicien :
- <a href="carnet/rss/{$smarty.session.hruid}/{$smarty.session.token}/rss.xml" title="Notifications">{icon name=feed title='fil rss'}</a>
+ <a href="carnet/rss/{$smarty.session.hruid}/{$smarty.session.user->token}/rss.xml" title="Notifications">{icon name=feed title='fil rss'}</a>
</li>
</ul>
<p>
<strong>Si vous êtes un recruteur ou une entreprise, / if you are a recruiter or a company,</strong>
<ul>
<li class="spaced">
- vous avez la possibilité
+ vous avez la possibilité
<strong><a href="http://www.manageurs.com/?langue=fr">d'utiliser le site
Manageurs.com</a></strong> pour rentrer en contact avec les
polytechniciens, mettre en ligne des offres d'emploi, consulter l'annuaire
<br />
<fieldset style="width: 70%; margin-left: 15%">
<legend>{icon name=lock} Saisie du nouveau mot de passe</legend>
- <form action="{$smarty.server.REQUEST_URI}" method="post" id="changepass">
+ <form action="{$smarty.server.REQUEST_URI}" method="post">
+ {xsrf_token_field}
<table style="width: 100%">
<tr>
<td class="titre">
Mot de passe :
</td>
<td>
- <input type="password" size="10" maxlength="256" name="nouveau" />
+ <input type="password" size="10" maxlength="256" name="new1" />
</td>
</tr>
<tr>
Retape-le une fois :
</td>
<td>
- <input type="password" size="10" maxlength="256" name="nouveau2" />
+ <input type="password" size="10" maxlength="256" name="new2" />
</td>
</tr>
<tr>
Sécurité
</td>
<td>
- {checkpasswd prompt="nouveau" submit="submitn"}
+ {checkpasswd prompt="new1" submit="submitn"}
</td>
</tr>
<tr>
<td colspan="2" class="center">
- <input type="submit" value="Changer" name="submitn" onclick="EnCryptedResponse(); return false;" />
+ <input type="hidden" name="pwhash" value="" />
+ <input type="submit" value="Changer" name="submitn" onclick="return hashResponse('new1', 'new2', true);" />
</td>
</tr>
</table>
</form>
- <form action="{$smarty.server.REQUEST_URI}" method="post" id="changepass2">
- <div>
- {xsrf_token_field}
- <input type="hidden" name="response2" value="" />
- </div>
- </form>
</fieldset>
<p>
</tr>
<tr class="impair">
<td class="half">
- {if $smarty.session.email_format eq html}
+ {if $smarty.session.user->email_format eq 'html'}
<h3>
<a href="javascript:dynpostkv('prefs','email_format','text')">Recevoir les emails en format texte</a>
</h3>
</td>
<td class="half">
<h3>
- {if $smarty.session.token}
+ {if $smarty.session.user->token}
<a href="javascript:dynpostkv('prefs','rss',0)">Désactiver les fils rss</a>
{else}
<a href="javascript:dynpostkv('prefs','rss',1)">Activer les fils rss</a>
<select name="medal_sel" onchange="updateMedal()">
<option value=''> </option>
{foreach from=$medal_list key=type item=list}
- <optgroup label="{$trad[$type]}…">
+ <optgroup label="{$fullType[$type]}…">
{foreach from=$list item=m}
<option value="{$m.id}">{$m.text}</option>
{/foreach}
{foreach from=$medals item=medal key=id}
{include file="profile/deco.medal.tpl" medal=$medal id=$id}
{/foreach}
- <div class="center"><small>Si ta décoration ou ta médaille ne figure pas dans la liste,
- <a href="mailto:support@{#globals.mail.domain#}">contacte-nous</a>.</small></div>
+ <p class="center"><small>Si ta décoration ou ta médaille ne figure pas dans la liste,
+ <a href="mailto:support@{#globals.mail.domain#}">contacte-nous</a>.</small></p>
</td>
</tr>
</table>
educationDegree = new Array({education_degree});
educationDegreeAll = new Array({education_degree_all});
-educationDegreeName = new Array({education_degree_name});
+educationDegreeName = new Array({education_degree_name});
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
<table class="bicol" style="margin-bottom: 1em" summary="Profil : Noms">
<tr>
- <th colspan="3">Noms</th>
+ <th colspan="3">Noms{if $validation} <small>(validations en attente de modération)</small>{/if}</th>
</tr>
<tr>
<td class="titre">
<h1>Mes groupes X sur Polytechnique.net</h1>
-<p class="center">
-[<a href="http://www.polytechnique.net/login/plan">Tous les groupes X</a>]
-</p>
+<p class="center">
+[<a href="http://www.polytechnique.net/login/plan">Tous les groupes X</a>]
+</p>
{foreach from=$assos item="asso"}
<div style="width:48%;float:left" >
{* *}
{**************************************************************************}
-<div>{icon name=information title="Afficher ma fiche référent"}Tu peux consulter ta <a class="popup2" href="referent/{$smarty.session.hruid}">fiche référent</a> qui n'est accessible que par les X.
+<div>{icon name=information title="Afficher ma fiche référent"}Tu peux consulter ta <a class="popup2" href="referent/{$hrpid}">fiche référent</a> qui n'est accessible que par les X.
</div>
{if (!$expertise)||(!($sectors|@count))}
<br /><div>
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2010 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+{config_load file="mails.conf" section="profile"}
+{if $mail_part eq 'head'}
+{from full=#from#}
+{cc full=#cc#}
+{subject text="Modification de ton profil"}
+{elseif $mail_part eq 'wiki'}
+{if $sex}Chère{else}Cher{/if} {$yourself},
+
+Les champs suivants de ton profil ont été modifiés le {$date|date_format:"%x"} :
+{foreach from=$modifications item=modification}
+*{$modification.field} : « {$modification.oldText} » est devenu « {$modification.newText} » (effectuée par {$modification.full_name}).
+{/foreach}
+
+Tu peux voir ta fiche là :
+*{$globals->baseurl}/profile/{$hrpid}
+Tu peux aussi l'éditer toi-même là :
+*{$globals->baseurl}/profile/edit/{$hrpid}
+
+{include file="signature.mail.tpl"}
+
+{/if}
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
<div id="fiche">
<div id="photo" class="part">
{assign var=photo value=$profile->getPhoto(false)}
- {if $photo}<img alt="Photo de {$profile->fullName()}" src="photo/{$profile->hrid()}" width="{$photo->width()}"/>{/if}
+ {if $photo}<img alt="Photo de {$profile->fullName()}" src="photo/{$profile->hrid()}{if $with_pending_pic}/req{/if}" width="{$photo->width()}"/>{/if}
{if $logged && $view eq 'private' && ( $profile->section|smarty:nodefaults || $profile->getBinets()|smarty:nodefaults || ($owner && $owner->groups()|smarty:nodefaults))}
<h2>À l'X…</h2>
<div id="fiche_identite" class="part">
<div class="civilite">
{if $profile->isFemale()}•{/if}
- <span {if $profile->name_tooltip neq ""}class="hinted" title="{$profile->name_tooltip}"{/if}>{$profile->shortName()}</span>
- {if $logged}
- {if $profile->nickname} (alias {$profile->nickname}){/if}
- {/if}
+ {if $logged}{$profile->private_name}{else}{$profile->public_name}{/if}
{if $logged}
{if !$profile->isDead()}<a href="vcard/{$owner->login()}.vcf">{*
{/if}
<div class='spacer'></div>
</div>
+ {else}
+ <div class='spacer'></div>
{/if}
<div class='formation'>
- {foreach from=$profile->nationalities() item=nat}
- <img src='images/flags/{$nat}.gif' alt='{$nat}' height='11' title='{$nat}' />
+ {foreach from=$profile->nationalities() item=country key=code}
+ <img src='images/flags/{$code}.gif' alt='{$code}' height='11' title='{$country}' />
{/foreach}
{$profile->promo()}
{assign var=corps value=$profile->getCorps()}
{if $corps && ($corps->current || $corps->original)}
- <ul>
+ <ul>
{if $corps->current}
- <li>Corps actuel : {$corps->current_name} {$corps->current_rank}</li>
+ <li>
+ Corps actuel : {$corps->current_name}
+ {if $corps->current_rank}({$corps->current_rank}){/if}
+ </li>
{/if}
- {if $corps->original}
+ {if $corps->current != $corps->original && $corps->original}
<li>Corps d'origine : {$corps->original_name}</li>
{/if}
- </ul>
+ </ul>
{/if}
</div>
} else {
Ajax.update_html('ssect_chg', baseurl + 'ssect/' + sector);
Ajax2.update_html('country_chg', baseurl + 'country/' + sector);
- document.getElementById('scat').style.display = '';
- document.getElementById('country').style.display = '';
- document.getElementById('keywords').style.display = '';
+ document.getElementById('scat').style.display = '';
+ document.getElementById('country').style.display = '';
+ document.getElementById('keywords').style.display = '';
document.getElementById('search_referent').disabled = '';
}
}
</th>
</tr>
<tr>
- <td class="titre">
+ <td class="titre">
Nom <span class="smaller">(à l'X)</span>
</td>
<td>
Tu n'as pour le moment aucun homonyme dans notre base de données. Nous allons
donc te donner l'adresse <strong>{$smarty.session.subState.bestalias}@{#globals.mail.domain#}</strong>,
en plus de ton adresse à vie <strong>{$smarty.session.subState.forlife}@{#globals.mail.domain#}</strong>.
- Note que tu pourrais perdre l'adresse <strong>{$smarty.session.subState.bestalias}@{#globals.mail.domain#}</strong>
+ Note que tu pourrais perdre l'adresse <strong>{$smarty.session.subState.bestalias}@{#globals.mail.domain#}</strong>
si un homonyme s'inscrivait, même si cela reste assez rare.
</p>
{else}
de ton adresse à vie <strong>{$smarty.session.subState.forlife}@{#globals.mail.domain#}</strong>.
</p>
{/if}
-
+
<p>
Ces adresses sont des redirections vers une ou plusieurs adresses email de ton choix.
Indiques-en une pour terminer ton inscription. Tu pourras la modifier ou ajouter d'autres
adresses une fois inscrit.
</p>
<p>
- Attention, cette adresse doit <strong>impérativement être valide</strong> pour que nous puissions
+ Attention, cette adresse doit <strong>impérativement être valide</strong> pour que nous puissions
t'envoyer tes informations de connexion.
</p>
<span class="smaller">au moins 6 caractères</span>
</td>
<td>
- <input type="hidden" name="response2" />
- <input type="password" size="10" maxlength="256" name="password" /><br/>
+ <input type="hidden" name="pwhash" />
+ <input type="password" size="10" maxlength="256" name="password1" /><br/>
<input type="password" size="10" maxlength="256" name="password2" /> (retape ton mot de passe)<br />
- {checkpasswd prompt="password" text="Terminer la pré-inscription"}
+ {checkpasswd prompt="password1" text="Terminer la pré-inscription"}
</td>
</tr>
</table>
</tr>
<tr class="impair">
<td class="center">
- <input type="submit" name="submitn" value="Continuer" onclick="EncryptedResponseInNestedForm(); return false;" />
+ <input type="submit" name="submitn" value="Continuer" onclick="return hashResponse('password1', 'password2', true);" />
</td>
</tr>
</table>
</form>
-<form action="register" id="changepass">
- <div>
- <input type="hidden" name="nouveau" />
- <input type="hidden" name="nouveau2" />
- </div>
-</form>
{/if}
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
</tr>
<tr>
<td colspan="2">
- <label for="only_current"><input name="only_current" id="only_current" type="checkbox"{if $smarty.request.only_current}
-checked="checked"{/if}/>Chercher uniquement les adresses où les camarades sont actuellement.</label></td>
+ <label for="only_current">
+ <input name="only_current" id="only_current" type="checkbox"{if $smarty.request.only_current} checked="checked"{/if}/>
+ Chercher uniquement les adresses où les camarades sont actuellement.
+ </label>
+ </td>
</tr>
<tr>
<th colspan="2">Activité</th>
<a href="search/adv">recherche avancée</a>
</strong>
</li>
-
+
<li>Effectuer une nouvelle <strong>
<a href="search">recherche simple</a>
</strong>
</li>
</ul>
-
+
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
</p>
<p>
Pour éviter ce genre d'écueils, il suffit de chercher : <code>Le Normand</code><br />
-En effet, le moteur de recherche va alors chercher tous les utilisateurs dont le nom
+En effet, le moteur de recherche va alors chercher tous les utilisateurs dont le nom
contient 'Le' <strong>et</strong> 'Normand' sans distinction de casse et sans tenir compte des accents.
</p>
<p>
http://www.polytechnique.org/bandeau.css.
Pour avoir l'icone, pour des raisons de sécurité il n'y a pas d'accès
direct, il faut alors rediriger bandeau/icone.png vers celle du site :
- http://www.polytechnique.org/bandeau/icone.png
+ http://www.polytechnique.org/bandeau/icone.png
-->
<!-- Don't copy this list of emails!!!
<div class="menu_title">Services</div>
<div class="menu_item"><a href="emails/send">Envoyer un email</a></div>
<div class="menu_item"><a href="banana/">Forums & PA</a></div>
-{if $smarty.session.googleapps}
+{if $smarty.session.user->googleapps}
<div class="menu_item"><a href="http://gmail.polytechnique.org/">Emails Google Apps</a></div>
{/if}
<div class="menu_item"><a href="lists">Listes de diffusion</a></div>
</td>
<td class="inscrits">
{$globals->core->NbIns|number_format} polytechniciens sur le web
+ {if t($smarty.request.quick)}
+ {assign var=requestQuick value=$smarty.request.quick}
+ {else}
+ {assign var=requestQuick value="Recherche dans l\'annuaire"}
+ {/if}
<form action="search" method="get">
<div>
- <input type="text" size="20" name="quick" id="quick" class="quick_search"
- value="{$smarty.request.quick|default:'Recherche dans l\'annuaire'}"
- onfocus="if (this.value === 'Recherche dans l\'annuaire') this.value='';
- $('#quick_button').show()"
- onblur="if (this.value === '') this.value='{$smarty.request.quick|default:'Recherche dans l\'annuaire'|escape:javascript}'"
- />
<button id="quick_button" type="submit" style="display: none"
onclick="if ($('#quick').val() === 'Recherche dans l\'annuaire') $('#quick').val('')">
OK
</button>
+ <input type="text" size="20" name="quick" id="quick" class="quick_search"
+ value="{$requestQuick}"
+ onfocus="if (this.value === 'Recherche dans l\'annuaire') this.value='';
+ $('#quick_button').show()"
+ onblur="if (this.value === '') this.value='{$requestQuick|escape:javascript}'"
+ />
</div>
</form>
{if $smarty.session.auth gt AUTH_PUBLIC && $smarty.session.notifs}
{if !$simple}
{include file=skin/common.bandeau.tpl}
{/if}
- {if $smarty.session.suid}
+ {if t($smarty.session.suid)}
<div id="suid">
<a href="exit">
Quitter le SU sur {$smarty.session.hruid} ({$smarty.session.perms->flags()})
{if !$simple}
{include file=skin/common.bandeau.tpl}
{/if}
- {if $smarty.session.suid}
+ {if t($smarty.session.suid)}
<div id="suid">
<a href="exit">
Quitter le SU sur {$smarty.session.hruid} ({$smarty.session.perms->flags()})
{if !$simple}
{include file=skin/common.bandeau.tpl}
{/if}
- {if $smarty.session.suid}
+ {if t($smarty.session.suid)}
<div id="suid">
<a href="exit">
Quitter le SU sur {$smarty.session.hruid} ({$smarty.session.perms->flags()})
{if !$simple}
{include file=skin/common.bandeau.tpl}
{/if}
- {if $smarty.session.suid}
+ {if t($smarty.session.suid)}
<div id="suid">
<a href="exit">
Quitter le SU sur {$smarty.session.hruid} ({$smarty.session.perms->flags()})
{if !$simple}
{include file=skin/common.bandeau.tpl}
{/if}
- {if $smarty.session.suid}
+ {if t($smarty.session.suid)}
<div id="suid">
<a href="exit">
Quitter le SU sur {$smarty.session.hruid} ({$smarty.session.perms->flags()})
{if !$simple}
{include file=skin/common.bandeau.tpl}
{/if}
- {if $smarty.session.suid}
+ {if t($smarty.session.suid)}
<div id="suid">
<a href="exit">
Quitter le SU sur {$smarty.session.hruid} ({$smarty.session.perms->flags()})
{if !$simple}
{include file=skin/common.bandeau.tpl}
{/if}
- {if $smarty.session.suid}
+ {if t($smarty.session.suid)}
<div id="suid">
<a href="exit">
Quitter le SU sur {$smarty.session.hruid} ({$smarty.session.perms->flags()})
{if !$simple}
{include file=skin/common.bandeau.tpl}
{/if}
- {if $smarty.session.suid}
+ {if t($smarty.session.suid)}
<div id="suid">
<a href="exit">
Quitter le SU sur {$smarty.session.hruid} ({$smarty.session.perms->flags()})
<body>
{include core=plpage.devel.tpl}
- {if $smarty.session.suid}
+ {if t($smarty.session.suid)}
<table id="suid" cellpadding="0" cellspacing="0">
<tr>
<td>
{if !$simple}
{include file=skin/common.bandeau.tpl}
{/if}
- {if $smarty.session.suid}
- <div id="suid">
- <a href="exit">
- Quitter le SU sur {$smarty.session.hruid} ({$smarty.session.perms->flags()})
- </a>
- </div>
- {/if}
+ {if t($smarty.session.suid)}
+ <div id="suid">
+ <a href="exit">
+ Quitter le SU sur {$smarty.session.hruid} ({$smarty.session.perms->flags()})
+ </a>
+ </div>
+ {/if}
{if $simple}
{if !$simple}
{include file=skin/common.bandeau.tpl}
{/if}
- {if $smarty.session.suid}
+ {if t($smarty.session.suid)}
<div id="suid">
<a href="exit">
Quitter le SU sur {$smarty.session.hruid} ({$smarty.session.perms->flags()})
{else}
{include file=skin/common.bandeau.tpl}
- {if $smarty.session.suid}
+ {if t($smarty.session.suid)}
<div id="suid">
<a href="exit">
Quitter le SU sur {$smarty.session.hruid} ({$smarty.session.perms->flags()})
{if !$simple}
{include file=skin/common.bandeau.tpl}
{/if}
- {if $smarty.session.suid}
+ {if t($smarty.session.suid)}
<div id="suid">
<a href="exit">
Quitter le SU sur {$smarty.session.hruid} ({$smarty.session.perms->flags()})
{if !$simple}
{include file=skin/common.bandeau.tpl}
{/if}
- {if $smarty.session.suid}
+ {if t($smarty.session.suid)}
<div id="suid">
<a href="exit">
Quitter le SU sur {$smarty.session.hruid} ({$smarty.session.perms->flags()})
<p>
Tu trouveras ici les interruptions de service de Polytechnique.org qui ont été
constatées <strong>durant les trois dernières semaines</strong>, ou qui sont prévues dans le futur.
- Il est à noter qu'à ce jour la quasi-totalité des coupures proviennent
+ Il est à noter qu'à ce jour la quasi-totalité des coupures proviennent
de défaillances du réseau de l'École, où nos serveurs sont hébergés (rupture de la
connexion internet de l'École, problème électrique…).
</p>
</a>
</td>
</tr>
- <script type="text/javascript">//<![CDATA[
+ <script type="text/javascript">//<![CDATA[
var id = new Array();
id['choices'] = {$survey_current.choices|@count};
id['subquestions'] = {$survey_current.subquestions|@count};
function newField(name, tid)
{
fid = "t" + id[name];
- $("#" + name + "_" + tid).before('<div id="' + name + '_' + fid + '">'
+ $("#" + name + "_" + tid).before('<div id="' + name + '_' + fid + '">'
+ '<input id="' + name + '_' + fid + '_field" type="text" name="survey_question[' + name + '][' + fid + ']" size="50" maxlength="200" value="" /> '
+ '<a href="javascript:removeField("' + name + '","' + fid + '")"><img src="images/icons/delete.gif" alt="" title="Supprimer" /></a>'
- + '</div>');
- id[name]++;
+ + '</div>');
+ id[name]++;
$("#" + name + "_" + fid + "_field").focus();
}
function removeField(name, tid)
{
$("#" + name + "_" + tid).remove();
}
- {/literal}
- //]]></script>
+ {/literal}
+ //]]></script>
{* vim:set et sw=2 sts=2 ts=8 enc=utf-8: *}
{literal}
$(document).ready(function() {
function hidePromo(value) {
- if (value == "0" || value == "") {
- $("#ln_promo").hide();
+ if (value == "0" || value == "") {
+ $("#ln_promo").hide();
$("#ln_promo_exp").hide();
- } else {
+ } else {
$("#ln_promo").show();
$("#ln_promo_exp").show();
- }
+ }
}
$("[name='survey_question[mode]']").change(function() { hidePromo(this.value); });
hidePromo({/literal}"{$survey_current.mode}"{literal});
<h1>Sondages</h1>
+{* Survey::MODE_ALL equals 0. *}
+{assign var=SurveyMODE_ALL value=0}
<table class="bicol">
<tr>
<th>
</th>
</tr>
{iterate item=s from=$survey_current}
- {if $smarty.session.auth || $s.mode == Survey::MODE_ALL}
+ {if $smarty.session.auth || $s.mode == $SurveyMODE_ALL}
<tr class="{cycle name=cs_cycle values="impair,pair"}">
<td class="half">
•
</th>
</tr>
{iterate item=s from=$survey_old}
- {if $smarty.session.auth || $s.mode == Survey::MODE_ALL}
+ {if $smarty.session.auth || $s.mode == $SurveyMODE_ALL}
<tr class="{cycle name=os_cycle values="impair,pair"}">
<td class="half">
•
<tr>
<td class="titre">Promotions :</td>
<td>
- {if $survey.promos eq "#"}
+ {if $survey.promos eq "#"}
<span class="erreur">erreur</span>
- {elseif $survey.promos eq ""}
- aucune restriction
- {else}
- {$survey.promos}
+ {elseif $survey.promos eq ""}
+ aucune restriction
+ {else}
+ {$survey.promos}
{/if}
</td>
</tr>
<div class="cat {if $cat eq institutions}sel{/if}"><a href="groups/institutions">Institutions</a></div>
<div class="cat {if $cat eq promotions}sel{/if}"><a href="groups/promotions">Promotions</a></div>
</td>
-
+
{if $doms}
<td style="vertical-align: top">
{foreach from=$doms item=g}
{/if}
{/foreach}
{/foreach}
- {assign var=asso_id value=$asso->id}
+ {if t($asso)}{assign var=asso_id value=$asso->id}{/if}
+ {if t($smarty.session.suid)}{assign var=suid value=true}{else}{assign var=suid value=false}{/if}
{if $asso && $is_admin ||
- ($smarty.session.suid && ($smarty.session.suid.perms->hasFlag('admin') ||
+ ($suid && ($smarty.session.suid.perms->hasFlag('admin') ||
$smarty.session.suid.may_update[$asso_id]))}
<h1>Voir le site comme…</h1>
<form method="post" action="{$platal->ns}change_rights">
<div>
<select name="right" onchange="this.form.submit()" style="margin: 0; padding: 0">
- {if hasPerm('admin') || ($smarty.session.suid && $smarty.session.suid.perms->hasFlag('admin'))}
+ {if hasPerm('admin') || ($suid && $smarty.session.suid.perms->hasFlag('admin'))}
<option value="admin" {if hasPerm('admin')}selected="selected"{/if}>Administrateur</option>
{/if}
<option value="anim" {if $is_admin && !hasPerm('admin')}selected="selected"{/if}>Animateur</option>
</tr>
{/foreach}
</table>
-
+
<div class="center">
{if $evt.eid}<input type="hidden" name="organisateur_uid" value="{$evt.organisateur_uid}" />{/if}
<input type="submit" name="valid" value="Valider" />
<h1>{$asso->nom} : Événements</h1>
{else}
<h1>
- {$asso->nom} :
+ {$asso->nom} :
{if $archive}[<a href="{$platal->ns}events">Événements</a>] {else}Événements {/if}
{if $archive}Archives {else}[<a href="{$platal->ns}events/archive">Archives</a>] {/if}
</h1>
{if $admin || $event.show_participants}
<p class='descr'>
- Tu peux
+ Tu peux
<a href="{$platal->ns}events/admin/{$event.eid}">
consulter la liste des participants
{icon name=group title="Liste des participants"}</a>
{elseif $event.paid < $event.topay}
Tu dois encore payer {math equation="a-b" a=$event.topay b=$event.paid|replace:'.':','} €
(tu as déjà payé {$event.paid|replace:'.':','} €).
- {else}
+ {else}
Tu as déjà payé {$event.paid|replace:'.':','} € pour ton inscription.
{/if}
</div>
{
var state = (box.checked ? 'none' : '');
document.getElementById('promo_titre').style.display = state;
+ document.getElementById('promo_explanation').style.display = state;
document.getElementById('promo_min_tr').style.display = state;
document.getElementById('promo_max_tr').style.display = state;
document.getElementById('promo_range_tr').style.display = state;
</td>
</tr>
<tr id="promo_titre" {if $art.public}style="display: none"{/if}>
- <th colspan="2">Promotions cibles</th>
+ <th colspan="2">Promotions d'entrée cibles</th>
+ </tr>
+ <tr id="promo_explanation" {if $art.public}style="display: none"{/if}>
+ <td colspan="2"><span class="smaller">{icon name=information} par exemple 2004 pour les X2004</span></td>
</tr>
{include file="include/field.promo.tpl" promo_min=$art.promo_min promo_max=$art.promo_max}
{if $art.public}
{if $is_admin}
<li>
<a href="{$platal->ns}member/new">
- {icon name=add title="Ajouter un membre"}
+ {icon name=add title="Ajouter un membre"}
Ajouter un membre
</a>
</li>
{if $asso->has_ml}
<li>
<a href="{$platal->ns}admin/annuaire">
- {icon name=wand title="Synchroniser"}
+ {icon name=wand title="Synchroniser"}
Synchroniser annuaire et listes de diffusion
</a>
</li>
{/if}
<li>
<a href="{$platal->ns}annuaire/csv/{$asso->diminutif}.csv">
- {icon name=page_excel title="Fichier Excel"}
+ {icon name=page_excel title="Fichier Excel"}
Obtenir au format Excel
</a>
</li>
<li>
<a href="{$platal->ns}annuaire/vcard/photos/{$asso->diminutif}.vcf">
- {icon name=vcard title="Carte de visite"}
+ {icon name=vcard title="Carte de visite"}
Ajouter les membres à ton carnet d'adresse
</a>
(<a href="{$platal->ns}annuaire/vcard/{$asso->diminutif}.vcf">sans les photos</a>)
<th>Actions</th>
{/if}
</tr>
+ {assign var=lostUsers value=false}
{foreach from=$users item=user}
<tr>
<td>
+ {if $user->lost}{assign var=lostUsers value=true}{/if}
{profile user=$user promo=false}
</td>
<td>
</p>
{/if}
-{if $broken}
+{if $lostUsers}
<p class="smaller">
{icon name=error} Un camarade signalé par ce symbole n'a plus d'adresse de redirection et ne peut donc
plus être contacté via son adresse polytechnique.org. Si tu connais sa nouvelle adresse, tu peux nous la communiquer en
<table class="tinybicol">
<tr>
<th>
- {if $smarty.session.token}
- <a href='{$platal->ns}rss/{$smarty.session.hruid}/{$smarty.session.token}/rss.xml' style="display:block;float:right">
+ {if $smarty.session.user->token}
+ <a href='{$platal->ns}rss/{$smarty.session.hruid}/{$smarty.session.user->token}/rss.xml' style="display:block;float:right">
{icon name=feed title='fil rss'}
</a>
{else}
</tr>
{iterate item=art from=$article_index}
<tr>
- <td>•
+ <td>•
{if $art.nonlu}
<a href="{$platal->ns}#art{$art.id}"><strong>
{else}
</td>
<td>
<select name="cat">
- <option value="groupesx" {if $asso->cat eq GroupesX}selected="selected"{/if}>Groupes X</option>
- <option value="binets" {if $asso->cat eq Binets}selected="selected"{/if}>Binets</option>
- <option value="promotions" {if $asso->cat eq Promotions}selected="selected"{/if}>Promotions</option>
- <option value="institutions" {if $asso->cat eq Institutions}selected="selected"{/if}>Institutions</option>
+ <option value="groupesx" {if $asso->cat eq 'GroupesX'}selected="selected"{/if}>Groupes X</option>
+ <option value="binets" {if $asso->cat eq 'Binets'}selected="selected"{/if}>Binets</option>
+ <option value="promotions" {if $asso->cat eq 'Promotions'}selected="selected"{/if}>Promotions</option>
+ <option value="institutions" {if $asso->cat eq 'Institutions'}selected="selected"{/if}>Institutions</option>
</select>
</td>
</tr>
<tr>
{if $art.photo}
<td rowspan="{if ($is_logged || $admin) && $art.contacts}3{else}2{/if}" style="width: 100px">
- <img src="{$platal->ns}announce/photo/{$art.id}" alt="{$art.titre}" style="width: 100px" />
+ <img src="{$platal->ns}announce/photo/{$art.id}" alt="{$art.titre}" style="width: 100px" />
</td>
{/if}
<td style="padding-bottom: 1em">
{elseif $smarty.post.inscrire}
<p class="descr">
-<strong>Ta demande d'inscription a bien été envoyée !</strong> Tu seras averti{if $smarty.session.femme}e{/if} par email de la suite qui lui sera donnée.
+<strong>Ta demande d'inscription a bien été envoyée !</strong> Tu seras averti{if $smarty.session.user->gender}e{/if} par email de la suite qui lui sera donnée.
<p>
<p class="descr">[<a href="{$platal->ns}">Retour à la page d'accueil de {$asso->nom}</a>]</p>
}
{/literal}
//]]></script>
-
+
<form action="{$platal->ns}mail" method="post" enctype="multipart/form-data" onsubmit="return check(this);">
{xsrf_token_field}
<table class='bicol'>
<tr>
<td colspan="2">
<input type="checkbox" id="x" name="x" onchange="xStateChange(this);" />
+ {* TODO: adapts text for masters and doctorates when required. *}
<label for="x">Coche cette case s'il s'agit d'un X non inscrit à Polytechnique.org.</label>
</td>
</tr>
</tr>
<tr id="xpromo" style="display: none">
<td class="titre">Promotion :</td>
- <td><input type="text" id="promo" name="promo" size="4" value="" onkeyup="searchX();" /></td>
+ {* TODO: add examples for masters and doctorates when required. *}
+ <td><input type="text" id="promo" name="promo" size="4" value="" onkeyup="searchX();" /> <small>(X2004)</small></td>
</tr>
<tr id="xsearch" style="display: none" class="pair">
<td colspan="2" id="search_result">
</p>
{else}
-
+
<h1>{$asso->nom} : gestion des membres</h1>
<h2>
Type d'utilisateur :
</td>
<td>
- <select name="type" onchange="showInformations(this); return true"{if $user->profile()} disabled="disabled"{/if}>
+ <select name="type" onchange="showInformations(this); return true">
<option value="xnet" {if $user->type neq 'virtual'}selected="selected"{/if}>Personne physique</option>
<option value="virtual" {if $user->type eq "virtual"}selected="selected"{/if}>Personne morale</option>
</select>
Nom affiché :
</td>
<td>
- <input type="text" value="{$user->displayName()}" name="display_name" size="40"{if $user->profile()} disabled="disabled"{/if} />
+ <input type="text" value="{$user->displayName()}" name="display_name" size="40" />
</td>
</tr>
<tr class="impair">
Nom complet :
</td>
<td>
- <input type="text" value="{$user->fullName()}" name="full_name" size="40"{if $user->profile()} disabled="disabled"{/if} />
+ <input type="text" value="{$user->fullName()}" name="full_name" size="40" />
+ </td>
+ </tr>
+ <tr class="impair">
+ <td class="titre">
+ Nom annuaire :
+ </td>
+ <td>
+ <input type="text" value="{$user->directoryName()}" name="directory_name" size="40" />
</td>
</tr>
<tr id="sexe" class="impair" {if $user->type eq "virtual"}style="display: none"{/if}>
Sexe :
</td>
<td>
- <select name="sex"{if $user->profile()} disabled="disabled"{/if}>
+ <select name="sex">
<option value="male"{if !$user->isFemale()} selected="selected"{/if}>Homme</option>
<option value="female"{if $user->isFemale()} selected="selected"{/if}>Femme</option>
</select>
</td>
</tr>
+ {/if}
+ {if !$user->profile() || !$user->perms}
<tr class="impair">
<td class="titre">
Email :
</td>
<td>
- <input type="text" value="{$user->forlifeEmail()}" name="email" size="40"{if $user->profile()} disabled="disabled"{/if} />
+ <input type="text" value="{$user->forlifeEmail()}" name="email" size="40" />
</td>
</tr>
{/if}
<input type="submit" name='change' value="Valider ces changements" />
<input type="reset" value="Annuler ces changements" />
- </div>
+ </div>
</form>
<form action="{$platal->ns}subscribe/valid" method="post">
<table class="tinybicol">
<tr>
- <th><a href="javascript:toggleSelection()">{icon name="arrow_refresh" title="Inverser la sélection"}</a></th>
+ <th><a href="javascript:toggleSelection()">{icon name="arrow_refresh" title="Inverser la sélection"}</a></th>
<th>Prénom Nom (Promotion)</th>
<th>Date de demande</th>
<th></th>
<p>[<a href='{$platal->ns}lists'>retour à la page des listes</a>]</p>
<h1>Membres de {$platal->argv[1]}</h1>
-
+
<table class='tinybicol'>
{if $mem|@count}
{foreach from=$mem item=m}
l'accord préalable des responsables du groupe.
</p>
<p class="descr">
-La dernière colonne du tableau t'indique si tu es inscrit{if $smarty.session.femme}e{/if} ou non à
+La dernière colonne du tableau t'indique si tu es inscrit{if $smarty.session.user->gender}e{/if} ou non à
la liste. Dans le premier cas, une croix rouge te permet de te désabonner. Dans le second cas, une
croix verte te permet de t'inscrire, après accord des responsables si l'inscription est modérée.
</p>
</table>
<p class="descr">
-{icon name=wrench title="Modérateur"} tu es {if $smarty.session.femme}modératrice{else}moderateur{/if} sur cette liste.<br />
+{icon name=wrench title="Modérateur"} tu es {if $smarty.session.user->gender}modératrice{else}moderateur{/if} sur cette liste.<br />
{icon name=weather_cloudy title="Liste privée"} cette liste est invisible aux non-membres de la liste. S'en désabonner
t'empêcherait de t'y réabonner par la suite sans l'aide d'un administrateur.
</p>
-
+
<h2>Voici les alias existants pour le groupe {$asso->nom} :</h2>
<table cellspacing="0" cellpadding="0" class='large'>
alter table emails change flags flags enum('active', 'filter', 'panne') not null default 'active';
UPDATE emails SET last = panne WHERE last = 0 AND panne != 0;
UPDATE emails
- SET panne_level = 1
- WHERE flags = 'active'
+ SET panne_level = 1
+ WHERE flags = 'active'
AND DATE_ADD(panne, INTERVAL 2 MONTH) > CURDATE();
-alter table skins change date date date not null default 0;
+alter table skins change date date date not null default 0;
INSERT INTO skins (id, name, date, comment, auteur, skin_tpl, ext)
VALUES (13, 'Keynote', '2006-08-09', 'Skin inspirée d\'un thème de Keynote',
'Florent Bruneau', 'keynote.tpl', 'png');
UPDATE newsletter_art SET body =
-REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(body,
+REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(body,
"[b]", "'''"),
"[/b]", "'''"),
"[i]", "''"),
alter table aliases add index (flags);
update aliases AS a
-left join aliases AS b
+left join aliases AS b
ON(a.id=b.id and b.alias like '%.%' and length(b.alias)<length(a.alias) and b.type!='homonyme')
set a.flags=CONCAT(a.flags,',bestalias')
where a.alias LIKE '%.%' and b.alias IS NULL and a.type!='homonyme';
('ordre', 'Ordre du Mérite Agricole', 'ordre_ma.jpg'),
('ordre', 'Ordre du Mérite Maritime', 'ordre_mm.jpg'),
('ordre', 'Ordre des Arts et des Lettres', 'ordre_al.jpg'),
-
('croix', 'Croix de Guerre 1914 - 1918', 'croix_1418.jpg'),
('croix', 'Croix de Guerre 1939 - 1945', 'croix_3945.jpg'),
('croix', 'Croix des T. O. E.', 'croix_toe.jpg'),
ADD adr_pub ENUM('private', 'ax', 'public') DEFAULT 'private' NOT NULL,
ADD tel_pub ENUM('private', 'ax', 'public') DEFAULT 'private' NOT NULL;
UPDATE entreprises SET
-pub = IF(FIND_IN_SET('entreprise_public', visibilite), 'public', IF(FIND_IN_SET('entreprise_ax', visibilite), 'ax', 'private')),
-adr_pub = IF(FIND_IN_SET('adr_public', visibilite), 'public', IF(FIND_IN_SET('adr_ax', visibilite), 'ax', 'private')),
+pub = IF(FIND_IN_SET('entreprise_public', visibilite), 'public', IF(FIND_IN_SET('entreprise_ax', visibilite), 'ax', 'private')),
+adr_pub = IF(FIND_IN_SET('adr_public', visibilite), 'public', IF(FIND_IN_SET('adr_ax', visibilite), 'ax', 'private')),
tel_pub = IF(FIND_IN_SET('tel_public', visibilite), 'public', IF(FIND_IN_SET('tel_ax', visibilite),'ax', 'private'));
ALTER TABLE entreprises DROP visibilite;
ALTER TABLE entreprises
-UPDATE watch_cat SET mail = "Ces camarades nous ont quittés", mail_sg = "Ce camarade nous a quittés" WHERE id = 3;
+UPDATE watch_cat SET mail = "Ces camarades nous ont quittés", mail_sg = "Ce camarade nous a quittés" WHERE id = 3;
ALTER TABLE virtual CHANGE `type` `type` ENUM('user', 'list', 'dom', 'evt') DEFAULT 'user' NOT NULL;
ALTER TABLE groupex.asso ADD `pub` ENUM( 'public', 'private' ) DEFAULT 'public' NOT NULL AFTER `ax` ;
-INSERT INTO virtual_domains VALUES ('evts.polytechnique.org');
+INSERT INTO virtual_domains VALUES ('evts.polytechnique.org');
use groupex;
INSERT INTO admin_h2 VALUES(2, 11, 'Géoloc', 70);
-INSERT INTO admin_a VALUES(11, 'Synchro', 'admin/geoloc.php',0);
+INSERT INTO admin_a VALUES(11, 'Synchro', 'admin/geoloc.php',0);
--- /dev/null
+ALTER TABLE profile_job_enum MODIFY COLUMN acronym VARCHAR(255) DEFAULT NULL;
+ALTER TABLE profile_job_enum MODIFY COLUMN url VARCHAR(255) DEFAULT NULL;
+ALTER TABLE profile_job_enum MODIFY COLUMN email VARCHAR(255) DEFAULT NULL;
+ALTER TABLE profile_job_enum MODIFY COLUMN NAF_code CHAR(5) DEFAULT NULL;
+
+-- vim:set syntax=mysql:
--- /dev/null
+DROP TABLE IF EXISTS profile_modifications;
+
+CREATE TABLE profile_modifications (
+ pid INT(11) NOT NULL,
+ uid INT(11) NOT NULL,
+ field VARCHAR(60) NOT NULL,
+ oldText TEXT NOT NULL,
+ newText TEXT NOT NULL,
+ pub ENUM('private', 'ax', 'public') NOT NULL DEFAULT 'private',
+ PRIMARY KEY(pid, uid, field)
+) ENGINE=InnoDB, CHARSET=utf8;
+
+-- vim:set syntax=mysql:
--- /dev/null
+ALTER TABLE accounts ADD COLUMN directory_name VARCHAR(255) DEFAULT NULL;
+UPDATE accounts AS a
+ SET a.directory_name = (SELECT pd.directory_name
+ FROM profile_display AS pd
+ INNER JOIN account_profiles AS ap ON (ap.uid = pd.pid AND FIND_IN_SET('owner', perms))
+ WHERE a.uid = ap.uid);
+
+-- vim:set syntax=mysql:
--- /dev/null
+ALTER TABLE profile_medal_enum MODIFY COLUMN type ENUM('ordre','croix','militaire','honneur','resistance','prix','sport') NOT NULL DEFAULT 'ordre';
+
+INSERT INTO profile_medal_enum (type, text, flags)
+ VALUES ('sport', 'Championnat du monde de vol à voile', 'validation'),
+ ('sport', 'Championnat d\'Europe de vol à voile', 'validation'),
+ ('sport', 'Championnat de France de vol à voile', 'validation');
+
+INSERT INTO profile_medal_grade_enum (mid, gid, text, pos)
+ SELECT id, 1, 'Or', 1
+ FROM profile_medal_enum
+ WHERE text = 'Championnat du monde de vol à voile'
+ OR text = 'Championnat d\'Europe de vol à voile'
+ OR text = 'Championnat de France de vol à voile';
+
+INSERT INTO profile_medal_grade_enum (mid, gid, text, pos)
+ SELECT id, 2, 'Argent', 2
+ FROM profile_medal_enum
+ WHERE text = 'Championnat du monde de vol à voile'
+ OR text = 'Championnat d\'Europe de vol à voile'
+ OR text = 'Championnat de France de vol à voile';
+
+INSERT INTO profile_medal_grade_enum (mid, gid, text, pos)
+ SELECT id, 3, 'Bronze', 3
+ FROM profile_medal_enum
+ WHERE text = 'Championnat du monde de vol à voile'
+ OR text = 'Championnat d\'Europe de vol à voile'
+ OR text = 'Championnat de France de vol à voile';
+
+-- vim:set syntax=mysql:
--- /dev/null
+../../bin/connect.db.inc.php
\ No newline at end of file
--- /dev/null
+#!/usr/bin/php5
+<?php
+require_once 'connect.db.inc.php';
+
+$globals->debug = 0; //do not store backtraces
+
+$phones = array(
+ 'AF' => '93',
+ 'AN' => '599',
+ 'BY' => '375',
+ 'FM' => '691',
+ 'GE' => '995',
+ 'GL' => '299',
+ 'ID' => '62',
+ 'IL' => '972',
+ 'IN' => '91',
+ 'IQ' => '964',
+ 'IR' => '98',
+ 'JO' => '962',
+ 'JP' => '81',
+ 'KG' => '996',
+ 'KW' => '965',
+ 'KZ' => '7',
+ 'LA' => '856',
+ 'LB' => '961',
+ 'LK' => '94',
+ 'MM' => '95',
+ 'MN' => '976',
+ 'MV' => '960',
+ 'MY' => '60',
+ 'NP' => '977',
+ 'OM' => '968',
+ 'PH' => '63',
+ 'PK' => '92',
+ 'QA' => '974',
+ 'SA' => '966',
+ 'SG' => '65',
+ 'SY' => '963',
+ 'TH' => '66',
+ 'TJ' => '992',
+ 'TM' => '993',
+ 'TR' => '90',
+ 'TW' => '886',
+ 'UZ' => '998',
+ 'VG' => '1284',
+ 'VN' => '84',
+ 'YE' => '967',
+);
+
+foreach ($phones as $country => $phone) {
+ XDB::execute('UPDATE geoloc_countries
+ SET phonePrefix = {?}
+ WHERE iso_3166_1_a2 = {?}',
+ $phone, $country);
+}
+
+/* vim:set et sw=4 sts=4 ts=4: */
+?>