================================================================================
+VERSION 1.1.4 XX XX XXXX
+
+New:
+
+ * Newsletter:
+ - Displays number of subscribers without any valid redirection -JAC
+
+Bug/Wish:
+
+ * Carnet:
+ - #1528: Do not display birthday of deceased users in emails -FUL
+
+ * Core:
+ - #1523: Rename AUTH_MDP to AUTH_PASSWD -JAC
+
+ * Email:
+ - #1529: Stores and uses preferences for sending emails from site -JAC
+
+ * Payments:
+ - #1512: Allows payments for unlogged users -JAC
+ - #1537: Replaces payments page on main site by a donation page -JAC
+
+ * Profile:
+ - #1535: Moves and displays skills with mentoring informations -JAC
+
+ * XnetGrp:
+ - #1525: Fixes broken page on erroneous group page edition -JAC
+ - #1530: Enables reminder for xnet accounts -JAC
+
+================================================================================
VERSION 1.1.3 10 09 2011
New:
* CAT: Florian El Ahdab (LeChat) <florian.el-ahdab@m4x.org>
* FAL: Raphaël Marichez (Falco) <raphael.marichez@m4x.org>
* FRU: Florent Bruneau (Fruneau) <florent.bruneau@m4x.org>
+ * FUL: Thomas Minvielle (Fulanor) <thomas.minvielle@m4x.org>
* GUI: Guillaume Bandet (GUI) <guillaume.bandet@m4x.org>
* JAC: Stéphane Jacob (jacou) <stephane.jacob@m4x.org>
* JM : Jean-Marc Bécu <jean-marc.becu@m4x.org>
$mailer->assign('email', $user['email']);
$mailer->assign('group', $user['group_name']);
$mailer->assign('sender_name', $user['sender_name']);
+ $mailer->assign('again', false);
$mailer->send();
XDB::execute('UPDATE accounts
const FETCH_MENTOR_TERMS = 0x000400;
const FETCH_DELTATEN = 0x000800;
const FETCH_PARTNER = 0x001000;
+ const FETCH_SKILL = 0x002000;
+ const FETCH_LANGUAGE = 0x004000;
const FETCH_MINIFICHES = 0x00012D; // FETCH_ADDRESSES | FETCH_EDU | FETCH_JOBS | FETCH_NETWORKING | FETCH_PHONES
- const FETCH_ALL = 0x001FFF; // OR of FETCH_*
+ const FETCH_ALL = 0x007FFF; // OR of FETCH_*
static public $descriptions = array(
'search_names' => 'Noms',
public function getEducations($flags, $limit = null)
{
if ($this->educations == null && !$this->fetched(self::FETCH_EDU)) {
- $this->setEducations($this->getProfileField(self::FETCH_EDU));
+ $educations = $this->getProfileField(self::FETCH_EDU);
+ if ($educations) {
+ $this->setEducations($educations);
+ }
}
if ($this->educations == null) {
public function getCorps()
{
if ($this->corps == null && !$this->fetched(self::FETCH_CORPS)) {
- $this->setCorps($this->getProfileField(self::FETCH_CORPS));
+ $corps = $this->getProfileField(self::FETCH_CORPS);
+ if ($corps) {
+ $this->setCorps($corps);
+ }
}
return $this->corps;
}
public function getMentoringCountries()
{
if ($this->mentor_countries == null && !$this->fetched(self::FETCH_MENTOR_COUNTRY)) {
- $this->setMentoringCountries($this->getProfileField(self::FETCH_MENTOR_COUNTRY));
+ $countries = $this->getProfileField(self::FETCH_MENTOR_COUNTRY);
+ if ($countries) {
+ $this->setMentoringCountries($countries);
+ }
}
if ($this->mentor_countries == null) {
public function getMentoringTerms()
{
if ($this->mentor_terms == null && !$this->fetched(self::FETCH_MENTOR_TERMS)) {
- $this->setMentoringTerms($this->getProfileField(self::FETCH_MENTOR_TERMS));
+ $terms = $this->getProfileField(self::FETCH_MENTOR_TERMS);
+ if ($terms) {
+ $this->setMentoringTerms($terms);
+ }
}
if ($this->mentor_terms == null) {
}
}
+ /* Skills */
+ private $skills = null;
+ public function setSkills(ProfileSkills $skills)
+ {
+ $this->skills = $skills;
+ }
+ public function getSkills()
+ {
+ if ($this->skills == null && !$this->fetched(self::FETCH_SKILL)) {
+ $skills = $this->getProfileField(self::FETCH_SKILL);
+ if ($skills) {
+ $this->setSkills($skills);
+ }
+ }
+
+ if ($this->skills == null) {
+ return array();
+ } else {
+ return $this->skills->skills;
+ }
+ }
+
+ /* Languades */
+ private $languages = null;
+ public function setLanguages(ProfileLanguages $languages)
+ {
+ $this->languages = $languages;
+ }
+ public function getLanguages()
+ {
+ if ($this->languages == null && !$this->fetched(self::FETCH_LANGUAGE)) {
+ $languages = $this->getProfileField(self::FETCH_LANGUAGE);
+ if ($languages) {
+ $this->setLanguages($languages);
+ }
+ }
+
+ if ($this->languages == null) {
+ return array();
+ } else {
+ return $this->languages->languages;
+ }
+ }
+
/** DeltaTen
*/
public function getMedals()
{
if ($this->medals == null && !$this->fetched(self::FETCH_MEDALS)) {
- $this->setMedals($this->getProfileField(self::FETCH_MEDALS));
+ $medals = $this->getProfileField(self::FETCH_MEDALS);
+ if ($medals) {
+ $this->setMedals($medals);
+ }
}
if ($this->medals == null) {
return array();
public function getPartnerSettings($partner_id)
{
if ($this->partners_settings === null && !$this->fetched(self::FETCH_PARTNER)) {
- $this->setPartnersSettings($this->getProfileField(self::FETCH_PARTNER));
+ $settings = $this->getProfileField(self::FETCH_PARTNER);
+ if ($settings) {
+ $this->setPartnersSettings($settings);
+ }
}
if ($this->partners_settings === null) {
return PartnerSettings::getEmpty($partner_id);
public function startAvailableAuth()
{
if (!S::logged() && Get::has('auth')) {
- if (!$this->start(AUTH_MDP)) {
+ if (!$this->start(AUTH_PASSWD)) {
return false;
}
}
return null;
}
Get::kill('auth');
- S::set('auth', AUTH_MDP);
+ S::set('auth', AUTH_PASSWD);
return User::getSilentWithValues(null, array('uid' => Get::i('uid')));
}
}
if ($level == AUTH_SUID) {
- S::set('auth', AUTH_MDP);
+ S::set('auth', AUTH_PASSWD);
}
S::set('uid', $user->uid);
$user = User::getSilent($login);
- $success = $this->checkPassword($login, $user, Post::v('response'));
-
if (!is_null($user) && S::suid()) {
$success = (S::suid('uid') == $user->id());
} else {
}
if ($success) {
- S::set('auth', AUTH_MDP);
+ S::set('auth', AUTH_PASSWD);
S::kill('challenge');
S::logger($user->id())->log('auth_ok');
}
return true;
}
if ($level == AUTH_SUID) {
- S::set('auth', AUTH_MDP);
+ S::set('auth', AUTH_PASSWD);
}
// Loads uid and hruid into the session for developement conveniance.
public function sureLevel()
{
- return AUTH_MDP;
+ return AUTH_PASSWD;
}
-Subproject commit a552b53ac5b4e512720d77b457bfda823ed3e10b
+Subproject commit 999c36caa0af1a215504c8043f906d6ee8f3c448
WHERE nlid = {?}', $this->id);
}
+ /** Get the count of subscribers with non valid redirection.
+ */
+ public function lostSubscriberCount()
+ {
+ return XDB::fetchOneCell('SELECT COUNT(DISTINCT(n.uid))
+ FROM newsletter_ins AS n
+ INNER JOIN accounts AS a ON (n.uid = a.uid)
+ INNER JOIN account_types AS t ON (t.type = a.type)
+ LEFT JOIN email_redirect_account AS r ON (r.uid = a.uid AND r.flags = \'active\' AND r.broken_level < 3
+ AND r.type != \'imap\' AND r.type != \'homonym\')
+ WHERE n.nlid = {?} AND r.redirect IS NULL AND a.state = \'active\' AND FIND_IN_SET(\'mail\', t.perms)',
+ $this->id);
+ }
+
/** Get the number of subscribers to the NL whose last received mailing was $last.
* @p $last ID of the issue for which subscribers should be counted.
* @return Number of subscribers
Profile::FETCH_MENTOR_COUNTRY => 'ProfileMentoringCountries',
Profile::FETCH_JOB_TERMS => 'ProfileJobTerms',
Profile::FETCH_MENTOR_TERMS => 'ProfileMentoringTerms',
+ Profile::FETCH_SKILL => 'ProfileSkills',
+ Profile::FETCH_LANGUAGE => 'ProfileLanguages',
Profile::FETCH_PARTNER => 'ProfilePartnerSharing',
);
}
}
// }}}
+// {{{ class ProfileSkills [ Field ]
+class ProfileSkills extends ProfileField
+{
+ public $skills = array();
+
+ public function __construct(PlInnerSubIterator $it)
+ {
+ $this->pid = $it->value();
+ while ($skill = $it->next()) {
+ $this->skills[$skill['cid']] = $skill;
+ }
+ }
+
+ public static function fetchData(array $pids, Visibility $visibility)
+ {
+ $data = XDB::iterator('SELECT ps.cid, pse.text_fr, ps.level, ps.pid
+ FROM profile_skills AS ps
+ INNER JOIN profile_skill_enum AS pse ON (pse.id = ps.cid)
+ WHERE ps.pid IN {?}
+ ORDER BY ' . XDB::formatCustomOrder('ps.pid', $pids),
+ $pids);
+ return PlIteratorUtils::subIterator($data, PlIteratorUtils::arrayValueCallback('pid'));
+ }
+}
+// }}}
+// {{{ class ProfileLanguages [ Field ]
+class ProfileLanguages extends ProfileField
+{
+ public $languages = array();
+
+ public function __construct(PlInnerSubIterator $it)
+ {
+ static $levels = array(
+ 1 => 'connaissance basique',
+ 2 => 'maîtrise des bases',
+ 3 => 'maîtrise limitée',
+ 4 => 'maîtrise générale',
+ 5 => 'bonne maîtrise',
+ 6 => 'maîtrise complète'
+ );
+
+ $this->pid = $it->value();
+ while ($language = $it->next()) {
+ $this->languages[$language['lid']] = $language;
+ $this->languages[$language['lid']]['level'] = $levels[$language['level']];
+ }
+ }
+
+ public static function fetchData(array $pids, Visibility $visibility)
+ {
+ $data = XDB::iterator('SELECT ps.lid, pse.language, ps.level, ps.pid
+ FROM profile_langskills AS ps
+ INNER JOIN profile_langskill_enum AS pse ON (pse.iso_639_2b = ps.lid)
+ WHERE ps.pid IN {?}
+ ORDER BY ' . XDB::formatCustomOrder('ps.pid', $pids),
+ $pids);
+ return PlIteratorUtils::subIterator($data, PlIteratorUtils::arrayValueCallback('pid'));
+ }
+}
+// }}}
// {{{ class ProfilePartnerSharing [ Field ]
class ProfilePartnerSharing extends ProfileField
{
public $asso;
public $evt;
public $evt_intitule;
- public $donation;
+ public $public;
public $rules = "Vérifier que les balises <salutation>, <prenom>, <nom>, <montant> et <comment> n'ont pas été modifiées.
Vérifier que le demandeur n'a pas laissé les crochets [].
public function __construct(User $_user, $_intitule, $_site, $_montant, $_msg,
$_montantmin=0, $_montantmax=999, $_asso_id = 0,
- $_evt = 0, $_donation = false, $_stamp=0)
+ $_evt = 0, $_public = false, $_stamp = 0)
{
parent::__construct($_user, false, 'paiements', $_stamp);
$this->msg_reponse = $_msg;
$this->asso_id = (string)$_asso_id;
$this->evt = (string)$_evt;
- $this->donation = $_donation;
$this->montant = $_montant;
$this->montant_min = $_montantmin;
$this->montant_max = $_montantmax;
+ $this->public = $_public;
if ($_asso_id) {
$res = XDB::query("SELECT nom FROM groups WHERE id = {?}", $_asso_id);
public function accept()
{
// no text [AI JMIAJM IJA MIJ]
- if (preg_match('/\[[-\'"A-Z ]+\]/', $this->msg_reponse)) {
+ if (preg_match('/\[[-\'"a-zA-Z ]+\]/', replace_accent($this->msg_reponse))) {
$this->trigError("La demande de paiement n'est pas valide. Merci de compléter le texte avant de la soumettre");
return false;
}
$this->montant_min = Env::i('pay_montant_min');
$this->montant_max = Env::i('pay_montant_max');
$this->msg_reponse = Env::v('pay_msg_reponse');
+ $this->public = (Env::v('pay_public') == 'yes');
return true;
}
{
$res = XDB::query("SELECT MAX(id) FROM payments");
$id = $res->fetchOneCell()+1;
- $flags = ($this->donation ? 'donation' : '');
- $ret = XDB::execute('INSERT INTO payments (id, text, url, flags, amount_def, amount_min, amount_max, mail, confirmation, asso_id)
+ $ret = XDB::execute('INSERT INTO payments (id, text, url, amount_def, amount_min, amount_max, mail, confirmation, asso_id, flags)
VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})',
- $id, $this->titre, $this->site, $flags, $this->montant, $this->montant_min,
- $this->montant_max, $this->user->bestEmail(), $this->msg_reponse, $this->asso_id);
+ $id, $this->titre, $this->site, $this->montant, $this->montant_min,
+ $this->montant_max, $this->user->bestEmail(), $this->msg_reponse, $this->asso_id,
+ ($this->public ? 'public' : ''));
if ($this->asso_id && $this->evt) {
XDB::execute("UPDATE group_events
SET paiement_id = {?}
function handlers()
{
return array(
- 'phpinfo' => $this->make_hook('phpinfo', AUTH_MDP, 'admin'),
+ 'phpinfo' => $this->make_hook('phpinfo', AUTH_PASSWD, 'admin'),
'get_rights' => $this->make_hook('get_rights', AUTH_COOKIE, 'admin'),
'set_skin' => $this->make_hook('set_skin', AUTH_COOKIE, 'admin'),
- 'admin' => $this->make_hook('default', AUTH_MDP, 'admin'),
- 'admin/dead-but-active' => $this->make_hook('dead_but_active', AUTH_MDP, 'admin'),
- 'admin/deaths' => $this->make_hook('deaths', AUTH_MDP, 'admin'),
- 'admin/downtime' => $this->make_hook('downtime', AUTH_MDP, 'admin'),
- 'admin/homonyms' => $this->make_hook('homonyms', AUTH_MDP, 'admin'),
- 'admin/logger' => $this->make_hook('logger', AUTH_MDP, 'admin'),
- 'admin/logger/actions' => $this->make_hook('logger_actions', AUTH_MDP, 'admin'),
- 'admin/postfix/blacklist' => $this->make_hook('postfix_blacklist', AUTH_MDP, 'admin'),
- 'admin/postfix/delayed' => $this->make_hook('postfix_delayed', AUTH_MDP, 'admin'),
- 'admin/postfix/regexp_bounces' => $this->make_hook('postfix_regexpsbounces', AUTH_MDP, 'admin'),
- 'admin/postfix/whitelist' => $this->make_hook('postfix_whitelist', AUTH_MDP, 'admin'),
- 'admin/mx/broken' => $this->make_hook('mx_broken', AUTH_MDP, 'admin'),
- 'admin/skins' => $this->make_hook('skins', AUTH_MDP, 'admin'),
- 'admin/user' => $this->make_hook('user', AUTH_MDP, 'admin'),
- 'admin/add_accounts' => $this->make_hook('add_accounts', AUTH_MDP, 'admin'),
- 'admin/validate' => $this->make_hook('validate', AUTH_MDP, 'admin,edit_directory'),
- 'admin/validate/answers' => $this->make_hook('validate_answers', AUTH_MDP, 'admin'),
- 'admin/wiki' => $this->make_hook('wiki', AUTH_MDP, 'admin'),
- 'admin/ipwatch' => $this->make_hook('ipwatch', AUTH_MDP, 'admin'),
- 'admin/icons' => $this->make_hook('icons', AUTH_MDP, 'admin'),
- 'admin/geocoding' => $this->make_hook('geocoding', AUTH_MDP, 'admin'),
- 'admin/accounts' => $this->make_hook('accounts', AUTH_MDP, 'admin'),
- 'admin/account/watch' => $this->make_hook('account_watch', AUTH_MDP, 'admin'),
- 'admin/account/types' => $this->make_hook('account_types', AUTH_MDP, 'admin'),
- 'admin/xnet_without_group' => $this->make_hook('xnet_without_group', AUTH_MDP, 'admin'),
- 'admin/jobs' => $this->make_hook('jobs', AUTH_MDP, 'admin,edit_directory'),
- 'admin/profile' => $this->make_hook('profile', AUTH_MDP, 'admin,edit_directory'),
- 'admin/phd' => $this->make_hook('phd', AUTH_MDP, 'admin'),
- 'admin/add_secondary_edu' => $this->make_hook('add_secondary_edu', AUTH_MDP, 'admin')
+ 'admin' => $this->make_hook('default', AUTH_PASSWD, 'admin'),
+ 'admin/dead-but-active' => $this->make_hook('dead_but_active', AUTH_PASSWD, 'admin'),
+ 'admin/deaths' => $this->make_hook('deaths', AUTH_PASSWD, 'admin'),
+ 'admin/downtime' => $this->make_hook('downtime', AUTH_PASSWD, 'admin'),
+ 'admin/homonyms' => $this->make_hook('homonyms', AUTH_PASSWD, 'admin'),
+ 'admin/logger' => $this->make_hook('logger', AUTH_PASSWD, 'admin'),
+ 'admin/logger/actions' => $this->make_hook('logger_actions', AUTH_PASSWD, 'admin'),
+ 'admin/postfix/blacklist' => $this->make_hook('postfix_blacklist', AUTH_PASSWD, 'admin'),
+ 'admin/postfix/delayed' => $this->make_hook('postfix_delayed', AUTH_PASSWD, 'admin'),
+ 'admin/postfix/regexp_bounces' => $this->make_hook('postfix_regexpsbounces', AUTH_PASSWD, 'admin'),
+ 'admin/postfix/whitelist' => $this->make_hook('postfix_whitelist', AUTH_PASSWD, 'admin'),
+ 'admin/mx/broken' => $this->make_hook('mx_broken', AUTH_PASSWD, 'admin'),
+ 'admin/skins' => $this->make_hook('skins', AUTH_PASSWD, 'admin'),
+ 'admin/user' => $this->make_hook('user', AUTH_PASSWD, 'admin'),
+ 'admin/add_accounts' => $this->make_hook('add_accounts', AUTH_PASSWD, 'admin'),
+ 'admin/validate' => $this->make_hook('validate', AUTH_PASSWD, 'admin,edit_directory'),
+ 'admin/validate/answers' => $this->make_hook('validate_answers', AUTH_PASSWD, 'admin'),
+ 'admin/wiki' => $this->make_hook('wiki', AUTH_PASSWD, 'admin'),
+ 'admin/ipwatch' => $this->make_hook('ipwatch', AUTH_PASSWD, 'admin'),
+ 'admin/icons' => $this->make_hook('icons', AUTH_PASSWD, 'admin'),
+ 'admin/geocoding' => $this->make_hook('geocoding', AUTH_PASSWD, 'admin'),
+ 'admin/accounts' => $this->make_hook('accounts', AUTH_PASSWD, 'admin'),
+ 'admin/account/watch' => $this->make_hook('account_watch', AUTH_PASSWD, 'admin'),
+ 'admin/account/types' => $this->make_hook('account_types', AUTH_PASSWD, 'admin'),
+ 'admin/xnet_without_group' => $this->make_hook('xnet_without_group', AUTH_PASSWD, 'admin'),
+ 'admin/jobs' => $this->make_hook('jobs', AUTH_PASSWD, 'admin,edit_directory'),
+ 'admin/profile' => $this->make_hook('profile', AUTH_PASSWD, 'admin,edit_directory'),
+ 'admin/phd' => $this->make_hook('phd', AUTH_PASSWD, 'admin'),
+ 'admin/add_secondary_edu' => $this->make_hook('add_secondary_edu', AUTH_PASSWD, 'admin')
);
}
'auth-redirect.php' => $this->make_hook('redirect', AUTH_COOKIE, 'user'),
'auth-groupex.php' => $this->make_hook('groupex_old', AUTH_COOKIE, ''),
'auth-groupex' => $this->make_hook('groupex', AUTH_PUBLIC, ''),
- 'admin/auth-groupes-x' => $this->make_hook('admin_authgroupesx', AUTH_MDP, 'admin'),
+ 'admin/auth-groupes-x' => $this->make_hook('admin_authgroupesx', AUTH_PASSWD, 'admin'),
);
}
'ax/out' => $this->make_hook('out', AUTH_PUBLIC),
'ax/show' => $this->make_hook('nl_show', AUTH_COOKIE, 'user'),
'ax/search' => $this->make_hook('nl_search', AUTH_COOKIE, 'user'),
- 'ax/admin' => $this->make_hook('admin_nl', AUTH_MDP, 'user'),
- 'ax/admin/edit' => $this->make_hook('admin_nl_edit', AUTH_MDP, 'user'),
- 'ax/admin/edit/valid' => $this->make_hook('admin_nl_valid', AUTH_MDP, 'user'),
- 'ax/admin/edit/cancel' => $this->make_hook('admin_nl_cancel', AUTH_MDP, 'user'),
- 'ax/admin/edit/delete' => $this->make_hook('admin_nl_delete', AUTH_MDP, 'user'),
- 'ax/admin/categories' => $this->make_hook('admin_nl_cat', AUTH_MDP, 'user'),
+ 'ax/admin' => $this->make_hook('admin_nl', AUTH_PASSWD, 'user'),
+ 'ax/admin/edit' => $this->make_hook('admin_nl_edit', AUTH_PASSWD, 'user'),
+ 'ax/admin/edit/valid' => $this->make_hook('admin_nl_valid', AUTH_PASSWD, 'user'),
+ 'ax/admin/edit/cancel' => $this->make_hook('admin_nl_cancel', AUTH_PASSWD, 'user'),
+ 'ax/admin/edit/delete' => $this->make_hook('admin_nl_delete', AUTH_PASSWD, 'user'),
+ 'ax/admin/categories' => $this->make_hook('admin_nl_cat', AUTH_PASSWD, 'user'),
);
}
{
return array(
'emails' => $this->make_hook('emails', AUTH_COOKIE, 'mail'),
- 'emails/alias' => $this->make_hook('alias', AUTH_MDP, 'mail'),
- 'emails/antispam' => $this->make_hook('antispam', AUTH_MDP, 'mail'),
+ 'emails/alias' => $this->make_hook('alias', AUTH_PASSWD, 'mail'),
+ 'emails/antispam' => $this->make_hook('antispam', AUTH_PASSWD, 'mail'),
'emails/broken' => $this->make_hook('broken', AUTH_COOKIE, 'user'),
- 'emails/redirect' => $this->make_hook('redirect', AUTH_MDP, 'mail'),
- 'emails/send' => $this->make_hook('send', AUTH_MDP, 'mail'),
+ 'emails/redirect' => $this->make_hook('redirect', AUTH_PASSWD, 'mail'),
+ 'emails/send' => $this->make_hook('send', AUTH_PASSWD, 'mail'),
'emails/antispam/submit' => $this->make_hook('submit', AUTH_COOKIE, 'user'),
'emails/test' => $this->make_hook('test', AUTH_COOKIE, 'mail', NO_AUTH),
'emails/imap/in' => $this->make_hook('imap_in', AUTH_PUBLIC),
- 'admin/emails/duplicated' => $this->make_hook('duplicated', AUTH_MDP, 'admin'),
- 'admin/emails/watch' => $this->make_hook('duplicated', AUTH_MDP, 'admin'),
- 'admin/emails/lost' => $this->make_hook('lost', AUTH_MDP, 'admin'),
- 'admin/emails/broken' => $this->make_hook('broken_addr', AUTH_MDP, 'admin'),
+ 'admin/emails/duplicated' => $this->make_hook('duplicated', AUTH_PASSWD, 'admin'),
+ 'admin/emails/watch' => $this->make_hook('duplicated', AUTH_PASSWD, 'admin'),
+ 'admin/emails/lost' => $this->make_hook('lost', AUTH_PASSWD, 'admin'),
+ 'admin/emails/broken' => $this->make_hook('broken_addr', AUTH_PASSWD, 'admin'),
);
}
foreach ($files as $name=>&$upload) {
$mymail->addUploadAttachment($upload, $name);
}
- if (Env::v('nowiki')) {
+ if (Env::v('wiki') == 'text') {
$mymail->setTxtBody(wordwrap($txt, 78, "\n"));
} else {
$mymail->setWikiBody($txt);
$page->assign('contacts', $contacts);
$page->assign('maxsize', ini_get('upload_max_filesize') . 'o');
$page->assign('user', S::user());
+ $preferences = XDB::fetchOneAssoc('SELECT from_email, from_format
+ FROM accounts
+ WHERE uid = {?}',
+ S::user()->id());
+ if ($preferences['from_email'] == '') {
+ $preferences['from_email'] = '"' . S::user()->fullName() . '" <' . S::user()->bestEmail() . '>';
+ }
+ $page->assign('preferences', $preferences);
}
function handler_test($page, $hruid = null)
'epletter/out' => $this->make_hook('out', AUTH_PUBLIC),
'epletter/show' => $this->make_hook('nl_show', AUTH_COOKIE, 'user'),
'epletter/search' => $this->make_hook('nl_search', AUTH_COOKIE, 'user'),
- 'epletter/admin' => $this->make_hook('admin_nl', AUTH_MDP, 'user'),
- 'epletter/admin/edit' => $this->make_hook('admin_nl_edit', AUTH_MDP, 'user'),
- 'epletter/admin/edit/valid' => $this->make_hook('admin_nl_valid', AUTH_MDP, 'user'),
- 'epletter/admin/edit/cancel' => $this->make_hook('admin_nl_cancel', AUTH_MDP, 'user'),
- 'epletter/admin/edit/delete' => $this->make_hook('admin_nl_delete', AUTH_MDP, 'user'),
- 'epletter/admin/categories' => $this->make_hook('admin_nl_cat', AUTH_MDP, 'user'),
+ 'epletter/admin' => $this->make_hook('admin_nl', AUTH_PASSWD, 'user'),
+ 'epletter/admin/edit' => $this->make_hook('admin_nl_edit', AUTH_PASSWD, 'user'),
+ 'epletter/admin/edit/valid' => $this->make_hook('admin_nl_valid', AUTH_PASSWD, 'user'),
+ 'epletter/admin/edit/cancel' => $this->make_hook('admin_nl_cancel', AUTH_PASSWD, 'user'),
+ 'epletter/admin/edit/delete' => $this->make_hook('admin_nl_delete', AUTH_PASSWD, 'user'),
+ 'epletter/admin/categories' => $this->make_hook('admin_nl_cat', AUTH_PASSWD, 'user'),
);
}
'events' => $this->make_hook('ev', AUTH_COOKIE, 'user'),
'events/preview' => $this->make_hook('preview', AUTH_PUBLIC, 'user', NO_AUTH),
'events/photo' => $this->make_hook('photo', AUTH_PUBLIC),
- 'events/submit' => $this->make_hook('ev_submit', AUTH_MDP, 'user'),
- 'admin/events' => $this->make_hook('admin_events', AUTH_MDP, 'admin'),
+ 'events/submit' => $this->make_hook('ev_submit', AUTH_PASSWD, 'user'),
+ 'admin/events' => $this->make_hook('admin_events', AUTH_PASSWD, 'admin'),
'rss' => $this->make_token_hook('rss', AUTH_COOKIE, 'user'),
'ajax/tips' => $this->make_hook('tips', AUTH_COOKIE, 'user', NO_AUTH),
- 'admin/tips' => $this->make_hook('admin_tips', AUTH_MDP, 'admin'),
+ 'admin/tips' => $this->make_hook('admin_tips', AUTH_PASSWD, 'admin'),
);
}
return array(
'banana' => $this->make_hook('banana', AUTH_COOKIE, 'forums'),
'banana/rss' => $this->make_hook('rss', AUTH_PUBLIC, 'forums', NO_HTTPS),
- 'admin/forums' => $this->make_hook('forums_bans', AUTH_MDP, 'admin'),
+ 'admin/forums' => $this->make_hook('forums_bans', AUTH_PASSWD, 'admin'),
);
}
{
if (Platal::globals()->merge->state == 'pending') {
return array(
- 'fusionax' => $this->make_hook('index', AUTH_MDP, 'admin'),
- 'fusionax/import' => $this->make_hook('import', AUTH_MDP, 'admin'),
- 'fusionax/view' => $this->make_hook('view', AUTH_MDP, 'admin'),
- 'fusionax/ids' => $this->make_hook('ids', AUTH_MDP, 'admin'),
- 'fusionax/deceased' => $this->make_hook('deceased', AUTH_MDP, 'admin'),
- 'fusionax/promo' => $this->make_hook('promo', AUTH_MDP, 'admin'),
- 'fusionax/names' => $this->make_hook('names', AUTH_MDP, 'admin'),
- 'fusionax/edu' => $this->make_hook('edu', AUTH_MDP, 'admin'),
- 'fusionax/corps' => $this->make_hook('corps', AUTH_MDP, 'admin')
+ 'fusionax' => $this->make_hook('index', AUTH_PASSWD, 'admin'),
+ 'fusionax/import' => $this->make_hook('import', AUTH_PASSWD, 'admin'),
+ 'fusionax/view' => $this->make_hook('view', AUTH_PASSWD, 'admin'),
+ 'fusionax/ids' => $this->make_hook('ids', AUTH_PASSWD, 'admin'),
+ 'fusionax/deceased' => $this->make_hook('deceased', AUTH_PASSWD, 'admin'),
+ 'fusionax/promo' => $this->make_hook('promo', AUTH_PASSWD, 'admin'),
+ 'fusionax/names' => $this->make_hook('names', AUTH_PASSWD, 'admin'),
+ 'fusionax/edu' => $this->make_hook('edu', AUTH_PASSWD, 'admin'),
+ 'fusionax/corps' => $this->make_hook('corps', AUTH_PASSWD, 'admin')
);
} elseif (Platal::globals()->merge->state == 'done') {
return array(
- 'fusionax' => $this->make_hook('index', AUTH_MDP, 'admin,edit_directory'),
- 'fusionax/issues' => $this->make_hook('issues', AUTH_MDP, 'admin,edit_directory'),
- 'fusionax/issues/deathdate' => $this->make_hook('issues_deathdate', AUTH_MDP, 'admin,edit_directory'),
- 'fusionax/issues/promo' => $this->make_hook('issues_promo', AUTH_MDP, 'admin,edit_directory'),
+ 'fusionax' => $this->make_hook('index', AUTH_PASSWD, 'admin,edit_directory'),
+ 'fusionax/issues' => $this->make_hook('issues', AUTH_PASSWD, 'admin,edit_directory'),
+ 'fusionax/issues/deathdate' => $this->make_hook('issues_deathdate', AUTH_PASSWD, 'admin,edit_directory'),
+ 'fusionax/issues/promo' => $this->make_hook('issues_promo', AUTH_PASSWD, 'admin,edit_directory'),
);
}
}
}
return array(
- 'googleapps' => $this->make_hook('index', AUTH_MDP, 'gapps'),
- 'admin/googleapps' => $this->make_hook('admin', AUTH_MDP, 'admin'),
- 'admin/googleapps/job' => $this->make_hook('admin_job', AUTH_MDP, 'admin'),
- 'admin/googleapps/user' => $this->make_hook('admin_user', AUTH_MDP, 'admin'),
+ 'googleapps' => $this->make_hook('index', AUTH_PASSWD, 'gapps'),
+ 'admin/googleapps' => $this->make_hook('admin', AUTH_PASSWD, 'admin'),
+ 'admin/googleapps/job' => $this->make_hook('admin_job', AUTH_PASSWD, 'admin'),
+ 'admin/googleapps/user' => $this->make_hook('admin_user', AUTH_PASSWD, 'admin'),
);
}
function handlers()
{
return array(
- 'lists' => $this->make_hook('lists', AUTH_MDP, 'user'),
- 'lists/ajax' => $this->make_hook('ajax', AUTH_MDP, 'user', NO_AUTH),
- 'lists/create' => $this->make_hook('create', AUTH_MDP, 'lists'),
+ 'lists' => $this->make_hook('lists', AUTH_PASSWD, 'user'),
+ 'lists/ajax' => $this->make_hook('ajax', AUTH_PASSWD, 'user', NO_AUTH),
+ 'lists/create' => $this->make_hook('create', AUTH_PASSWD, 'lists'),
'lists/members' => $this->make_hook('members', AUTH_COOKIE, 'user'),
'lists/csv' => $this->make_hook('csv', AUTH_COOKIE, 'user'),
'lists/archives' => $this->make_hook('archives', AUTH_COOKIE, 'user'),
'lists/archives/rss' => $this->make_hook('rss', AUTH_PUBLIC, 'user', NO_HTTPS),
- 'lists/moderate' => $this->make_hook('moderate', AUTH_MDP, 'user'),
- 'lists/admin' => $this->make_hook('admin', AUTH_MDP, 'user'),
- 'lists/options' => $this->make_hook('options', AUTH_MDP, 'user'),
- 'lists/delete' => $this->make_hook('delete', AUTH_MDP, 'user'),
+ 'lists/moderate' => $this->make_hook('moderate', AUTH_PASSWD, 'user'),
+ 'lists/admin' => $this->make_hook('admin', AUTH_PASSWD, 'user'),
+ 'lists/options' => $this->make_hook('options', AUTH_PASSWD, 'user'),
+ 'lists/delete' => $this->make_hook('delete', AUTH_PASSWD, 'user'),
- 'lists/soptions' => $this->make_hook('soptions', AUTH_MDP, 'user'),
- 'lists/check' => $this->make_hook('check', AUTH_MDP, 'user'),
- 'admin/lists' => $this->make_hook('admin_all', AUTH_MDP, 'admin'),
- 'admin/aliases' => $this->make_hook('aaliases', AUTH_MDP, 'admin')
+ 'lists/soptions' => $this->make_hook('soptions', AUTH_PASSWD, 'user'),
+ 'lists/check' => $this->make_hook('check', AUTH_PASSWD, 'user'),
+ 'admin/lists' => $this->make_hook('admin_all', AUTH_PASSWD, 'admin'),
+ 'admin/aliases' => $this->make_hook('aaliases', AUTH_PASSWD, 'admin')
);
}
function handlers()
{
return array(
- 'marketing' => $this->make_hook('marketing', AUTH_MDP, 'admin'),
- 'marketing/promo' => $this->make_hook('promo', AUTH_MDP, 'admin'),
- 'marketing/relance' => $this->make_hook('relance', AUTH_MDP, 'admin'),
- 'marketing/this_week' => $this->make_hook('week', AUTH_MDP, 'admin'),
- 'marketing/volontaire' => $this->make_hook('volontaire', AUTH_MDP, 'admin'),
+ 'marketing' => $this->make_hook('marketing', AUTH_PASSWD, 'admin'),
+ 'marketing/promo' => $this->make_hook('promo', AUTH_PASSWD, 'admin'),
+ 'marketing/relance' => $this->make_hook('relance', AUTH_PASSWD, 'admin'),
+ 'marketing/this_week' => $this->make_hook('week', AUTH_PASSWD, 'admin'),
+ 'marketing/volontaire' => $this->make_hook('volontaire', AUTH_PASSWD, 'admin'),
- 'marketing/private' => $this->make_hook('private', AUTH_MDP, 'admin'),
+ 'marketing/private' => $this->make_hook('private', AUTH_PASSWD, 'admin'),
'marketing/public' => $this->make_hook('public', AUTH_COOKIE, 'user'),
'marketing/broken' => $this->make_hook('broken', AUTH_COOKIE, 'user'),
);
'nl' => $this->make_hook('nl', AUTH_COOKIE, 'user'),
'nl/show' => $this->make_hook('nl_show', AUTH_COOKIE, 'user'),
'nl/search' => $this->make_hook('nl_search', AUTH_COOKIE, 'user'),
- 'nl/submit' => $this->make_hook('nl_submit', AUTH_MDP, 'user'),
- 'nl/remaining' => $this->make_hook('nl_remaining', AUTH_MDP, 'user'),
- 'admin/nls' => $this->make_hook('admin_nl_groups', AUTH_MDP, 'admin'),
- 'admin/newsletter' => $this->make_hook('admin_nl', AUTH_MDP, 'admin'),
- 'admin/newsletter/categories' => $this->make_hook('admin_nl_cat', AUTH_MDP, 'admin'),
- 'admin/newsletter/edit' => $this->make_hook('admin_nl_edit', AUTH_MDP, 'admin'),
- 'admin/newsletter/edit/delete' => $this->make_hook('admin_nl_delete', AUTH_MDP, 'admin'),
+ 'nl/submit' => $this->make_hook('nl_submit', AUTH_PASSWD, 'user'),
+ 'nl/remaining' => $this->make_hook('nl_remaining', AUTH_PASSWD, 'user'),
+ 'admin/nls' => $this->make_hook('admin_nl_groups', AUTH_PASSWD, 'admin'),
+ 'admin/newsletter' => $this->make_hook('admin_nl', AUTH_PASSWD, 'admin'),
+ 'admin/newsletter/categories' => $this->make_hook('admin_nl_cat', AUTH_PASSWD, 'admin'),
+ 'admin/newsletter/edit' => $this->make_hook('admin_nl_edit', AUTH_PASSWD, 'admin'),
+ 'admin/newsletter/edit/delete' => $this->make_hook('admin_nl_delete', AUTH_PASSWD, 'admin'),
// Automatic mailing is disabled for X.org NL
-// 'admin/newsletter/edit/cancel' => $this->make_hook('cancel', AUTH_MDP, 'admin'),
-// 'admin/newsletter/edit/valid' => $this->make_hook('valid', AUTH_MDP, 'admin'),
+// 'admin/newsletter/edit/cancel' => $this->make_hook('cancel', AUTH_PASSWD, 'admin'),
+// 'admin/newsletter/edit/valid' => $this->make_hook('valid', AUTH_PASSWD, 'admin'),
);
}
'openid' => $this->make_hook('openid', AUTH_PUBLIC),
'openid/melix' => $this->make_hook('melix', AUTH_PUBLIC),
'openid/xrds' => $this->make_hook('xrds', AUTH_PUBLIC),
- 'openid/trust' => $this->make_hook('trust', AUTH_MDP, 'user'),
- 'openid/trusted' => $this->make_hook('trusted', AUTH_MDP, 'user'),
- 'admin/openid/trusted' => $this->make_hook('admin_trusted', AUTH_MDP, 'admin'),
+ 'openid/trust' => $this->make_hook('trust', AUTH_PASSWD, 'user'),
+ 'openid/trusted' => $this->make_hook('trusted', AUTH_PASSWD, 'user'),
+ 'admin/openid/trusted' => $this->make_hook('admin_trusted', AUTH_PASSWD, 'admin'),
);
}
function handlers()
{
return array(
- 'payment' => $this->make_hook('payment', AUTH_MDP, 'payment'),
+ 'payment' => $this->make_hook('payment', AUTH_PUBLIC, 'user'),
'payment/cyber2_return' => $this->make_hook('cyber2_return', AUTH_PUBLIC, 'user', NO_HTTPS),
'payment/paypal_return' => $this->make_hook('paypal_return', AUTH_PUBLIC, 'user', NO_HTTPS),
- '%grp/paiement' => $this->make_hook('xnet_payment', AUTH_MDP, 'user'),
- '%grp/payment' => $this->make_hook('xnet_payment', AUTH_MDP, 'user'),
- '%grp/payment/csv' => $this->make_hook('payment_csv', AUTH_MDP, 'groupadmin'),
+ '%grp/paiement' => $this->make_hook('xnet_payment', AUTH_PUBLIC, 'user'),
+ '%grp/payment' => $this->make_hook('xnet_payment', AUTH_PUBLIC, 'user'),
+ '%grp/payment/csv' => $this->make_hook('payment_csv', AUTH_PASSWD, 'groupadmin'),
'%grp/payment/cyber2_return' => $this->make_hook('cyber2_return', AUTH_PUBLIC, 'user', NO_HTTPS),
'%grp/payment/paypal_return' => $this->make_hook('paypal_return', AUTH_PUBLIC, 'user', NO_HTTPS),
- 'admin/payments' => $this->make_hook('admin', AUTH_MDP, 'admin'),
- 'admin/payments/methods' => $this->make_hook('adm_methods', AUTH_MDP, 'admin'),
- 'admin/payments/transactions' => $this->make_hook('adm_transactions', AUTH_MDP, 'admin'),
- 'admin/reconcile' => $this->make_hook('adm_reconcile', AUTH_MDP, 'admin'),
- 'admin/reconcile/importlogs' => $this->make_hook('adm_importlogs', AUTH_MDP, 'admin'),
- 'admin/reconcile/transfers' => $this->make_hook('adm_transfers', AUTH_MDP, 'admin'),
- 'admin/reconcile/bankaccounts' => $this->make_hook('adm_bankaccounts', AUTH_MDP, 'admin'),
+ 'admin/payments' => $this->make_hook('admin', AUTH_PASSWD, 'admin'),
+ 'admin/payments/methods' => $this->make_hook('adm_methods', AUTH_PASSWD, 'admin'),
+ 'admin/payments/transactions' => $this->make_hook('adm_transactions', AUTH_PASSWD, 'admin'),
+ 'admin/reconcile' => $this->make_hook('adm_reconcile', AUTH_PASSWD, 'admin'),
+ 'admin/reconcile/importlogs' => $this->make_hook('adm_importlogs', AUTH_PASSWD, 'admin'),
+ 'admin/reconcile/transfers' => $this->make_hook('adm_transfers', AUTH_PASSWD, 'admin'),
+ 'admin/reconcile/bankaccounts' => $this->make_hook('adm_bankaccounts', AUTH_PASSWD, 'admin'),
);
}
function handler_payment($page, $ref = -1)
{
- global $globals;
-
+ $page->changeTpl('payment/payment.tpl');
+ $page->setTitle('Télépaiement');
$this->load('money.inc.php');
- if (!empty($GLOBALS['IS_XNET_SITE'])) {
- if (!$globals->asso('id')) {
- return PL_NOT_FOUND;
- }
- $res = XDB::query('SELECT asso_id
- FROM payments
- WHERE asso_id = {?} AND id = {?}',
- $globals->asso('id'), $ref);
- if (!$res->numRows()) {
- return PL_FORBIDDEN;
- }
- }
- $page->changeTpl('payment/index.tpl');
- $page->setTitle('Télépaiements');
-
- // initialisation
- $op = Env::v('op', 'select');
$meth = new PayMethod(Env::i('methode', -1));
$pay = new Payment($ref);
- if($pay->flags->hasflag('old')){
- $page->trigError("La transaction selectionnée est périmée.");
- $pay = new Payment();
+ if (!$pay->flags->hasflag('public') && (!S::user() || !S::logged())) {
+ $page->kill("Vous n'avez pas les permissions nécessaires pour accéder à cette page.");
+ } else {
+ $page->assign('public', true);
}
- $val = Env::v('montant') != 0 ? Env::v('montant') : $pay->amount_def;
- if (($e = $pay->check($val)) !== true) {
- $page->trigError($e);
+ if ($pay->flags->hasflag('old')) {
+ $page->kill('La transaction selectionnée est périmée.');
}
- if ($op == 'submit') {
- $pay->init($val, $meth);
- $pay->prepareform($pay);
- } else {
+ $val = (Post::v('amount') != 0) ? Post::v('amount') : $pay->amount_def;
+
+ if (($error = $pay->check($val)) !== true) {
+ $page->trigError($error);
+ }
+
+ if (Post::has('op') && Post::v('op', 'select') == 'submit') {
+ if (S::logged()) {
+ $user = S::user();
+ } else {
+ $user = User::getSilent(Post::t('login'));
+ }
+
+ if (is_null($user)) {
+ $page->trigError("L'identifiant est erroné.");
+ $page->assign('login_error', true);
+ $page->assign('login', Post::t('login'));
+ } else {
+ $pay->init($val, $meth);
+ $pay->prepareform($user);
+ $page->assign('full_name', $user->fullName(true));
+ $page->assign('sex', $user->isFemale());
+ }
+ } elseif (S::logged()) {
$res = XDB::iterator('SELECT ts_confirmed, amount
FROM payment_transactions
WHERE uid = {?} AND ref = {?}
ORDER BY ts_confirmed DESC',
- S::v('uid', -1), $ref);
+ S::v('uid', -1), $pay->id);
if ($res->total()) {
$page->assign('transactions', $res);
}
- if ($pay->flags->hasflag('donation')) {
- $donations = XDB::fetchAllAssoc('SELECT IF(p.display,
- IF(ap.pid IS NOT NULL, CONCAT(a.full_name, \' (\', pd.promo, \')\'), a.full_name),
- \'XXXX\') AS name, p.amount
- FROM payment_transactions AS p
- INNER JOIN accounts AS a ON (a.uid = p.uid)
- LEFT JOIN account_profiles AS ap ON (a.uid = ap.uid AND FIND_IN_SET(\'owner\', ap.perms))
- LEFT JOIN profile_display AS pd ON (ap.pid = pd.pid)
- WHERE p.ref = {?}
- ORDER BY LENGTH(p.amount) DESC, p.amount DESC, name',
- $ref);
- $sum = 0;
- foreach ($donations as $d) {
- $sum += $d['amount'];
- }
-
+ // Only if $id = -1, meaning only for donation the site's association
+ if ($ref == -1) {
+ $biggest_donations = XDB::fetchAllAssoc('SELECT IF(p.display,
+ IF(ap.pid IS NOT NULL, CONCAT(a.full_name, \' (\', pd.promo, \')\'), a.full_name),
+ \'XXXX\') AS name, p.amount, p.ts_confirmed
+ FROM payment_transactions AS p
+ INNER JOIN accounts AS a ON (a.uid = p.uid)
+ LEFT JOIN account_profiles AS ap ON (a.uid = ap.uid AND FIND_IN_SET(\'owner\', ap.perms))
+ LEFT JOIN profile_display AS pd ON (ap.pid = pd.pid)
+ WHERE p.ref = {?}
+ ORDER BY LENGTH(p.amount) DESC, p.amount DESC, name
+ LIMIT 10',
+ $pay->id);
+
+ $donations = XDB::fetchAllAssoc('(SELECT SUM(amount) AS amount, YEAR(ts_confirmed) AS year, MONTH(ts_confirmed) AS month, ts_confirmed
+ FROM payment_transactions
+ WHERE ref = {?} AND YEAR(ts_confirmed) = YEAR(CURDATE())
+ GROUP BY month)
+ UNION
+ (SELECT SUM(amount) AS amount, YEAR(ts_confirmed) AS year, 0 AS month, ts_confirmed
+ FROM payment_transactions
+ WHERE ref = {?} AND YEAR(ts_confirmed) < YEAR(CURDATE())
+ GROUP BY year)
+ ORDER BY year DESC, month DESC',
+ $pay->id, $pay->id);
+
+ $page->assign('biggest_donations', $biggest_donations);
$page->assign('donations', $donations);
- $page->assign('sum', strtr($sum, '.', ','));
+ $page->assign('donation', true);
}
}
- $val = floor($val*100)/100;
- $page->assign('montant', $val);
+ $val = floor($val * 100) / 100;
+ $page->assign('amount', $val);
$page->assign('comment', Env::v('comment'));
$page->assign('meth', $meth);
$page->assign('pay', $pay);
$page->assign('evtlink', $pay->event());
- $page->assign('sex', S::user()->isFemale());
- $page->assign('donation', $pay->flags->hasflag('donation'));
}
function handler_cyber2_return($page, $uid = null)
global $globals;
$perms = S::v('perms');
- if (!$perms->hasFlag('groupmember')) {
+ if (!(S::identified() && $perms->hasFlag('groupmember'))) {
if (is_null($pid)) {
return PL_FORBIDDEN;
}
INNER JOIN group_event_participants AS ep ON (ep.eid = e.eid AND ep.uid = {?})
WHERE e.paiement_id = {?} AND e.asso_id = {?}",
S::i('uid'), $pid, $globals->asso('id'));
- if ($res->numRows() == 0) {
+ $public = XDB::query("SELECT 1
+ FROM payments AS p
+ INNER JOIN group_events AS g ON (g.paiement_id = p.id)
+ WHERE g.asso_id = {?} AND p.id = {?} AND FIND_IN_SET('public', p.flags)",
+ $globals->asso('id'), $pid);
+ if ($res->numRows() == 0 && $public->numRows() == 0) {
return PL_FORBIDDEN;
}
}
// convert date
$a['date'] = preg_replace('/([0-9]{2})\/([0-9]{2})\/([0-9]{4}).*/', '\3-\2-\1', $a['date']);
$a['date'] = preg_replace('/T.*/','', $a['date']);
-
+
// convert money
$a['amount'] = str_replace(',', '.', $a['amount']);
$a['commission'] = str_replace(',', '.', $a['commission']);
class Payment
{
- // {{{ properties
-
- var $id;
- var $text;
- var $url;
- var $flags;
- var $mail;
- var $amount_min;
- var $amount_max;
- var $amount_def;
- var $asso_id;
-
- var $api = null;
-
- // }}}
- // {{{ constructor
-
- function Payment($ref=-1)
+ public $id;
+ public $text;
+ public $url;
+ public $flags;
+ public $mvarail;
+ public $amount_min;
+ public $amount_max;
+ public $amount_def;
+ public $asso_id;
+
+ public $api = null;
+
+ function Payment($ref = -1)
{
global $globals;
- $r = $ref==-1 ? $globals->money->mpay_def_id : $ref;
- $res = XDB::query("SELECT id, text, url, flags, mail, amount_min, amount_max, amount_def, asso_id
- FROM payments WHERE id={?}", $r);
+
+ $r = ($ref == -1) ? $globals->money->mpay_def_id : $ref;
+ $res = XDB::query('SELECT id, text, url, flags, mail, amount_min, amount_max, amount_def, asso_id
+ FROM payments
+ WHERE id = {?}', $r);
list($this->id, $this->text, $this->url, $flags, $this->mail,
$this->amount_min, $this->amount_max, $this->amount_def, $this->asso_id) = $res->fetchOneRow();
$this->amount_min = (float)$this->amount_min;
$this->amount_max = (float)$this->amount_max;
- $this->flags = new PlFlagSet($flags);
+ $this->flags = new PlFlagSet($flags);
}
- // }}}
- // {{{ function check()
-
function check($value)
{
$v = (float)strtr($value, ',', '.');
}
}
- // }}}
- // {{{ function init()
-
function init($val, $meth)
{
- require_once dirname(__FILE__).'/money/'.$meth->inc;
+ require_once dirname(__FILE__) . '/money/' . $meth->inc;
$this->api = new $api($val);
}
- // }}}
- // {{{ function prepareform()
-
- function prepareform()
+ function prepareform(User $user)
{
- return $this->api->prepareform($this);
+ return $this->api->prepareform($this, $user);
}
function event()
}
return null;
}
- // }}}
}
-// {{{ class PayMethod
-
class PayMethod
{
- // {{{ properties
-
- var $id;
- var $text;
- var $inc;
-
- // }}}
- // {{{ constructor
+ public $id;
+ public $text;
+ public $inc;
- function PayMethod($id=-1)
+ function PayMethod($id = -1)
{
global $globals;
- $i = $id==-1 ? $globals->money->mpay_def_meth : $id;
- $res = XDB::query("SELECT id,text,include FROM payment_methods WHERE id={?}", $i);
+
+ $i = ($id == -1) ? $globals->money->mpay_def_meth : $id;
+ $res = XDB::query('SELECT id, text, include
+ FROM payment_methods
+ WHERE id = {?}', $i);
list($this->id, $this->text, $this->inc) = $res->fetchOneRow();
}
-
- // }}}
}
-// }}}
-
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>
return trim(preg_replace('/\s\s+/', ' ', preg_replace('/[^a-zA-Z0-9]/', ' ', $string)));
}
- function prepareform($pay)
+ function prepareform($pay, $user)
{
global $globals, $platal;
$log = S::v('log');
'vads_return_mode' => 'NONE',
'vads_url_return' => $pay->url ? $pay->url : $globals->baseurl . '/' . $platal->ns);
$this->infos['client'] = Array(
- 'vads_cust_email' => S::user()->bestEmail(),
+ 'vads_cust_email' => $user->bestEmail(),
'vads_cust_id' => S::v('uid'),
- 'vads_cust_name' => substr(self::replaceNonAlpha(replace_accent(S::user()->shortName())), 0, 127));
+ 'vads_cust_name' => substr(self::replaceNonAlpha(replace_accent($user->shortName())), 0, 127));
$this->infos['commande'] = Array(
'vads_amount' => $this->val,
'vads_currency' => '978', # Euro
$this->val_number = $val;
}
- function prepareform($pay)
+ function prepareform($pay, $user)
{
// Documentation:
// https://www.paypal.com/developer
global $globals, $platal;
$this->urlform = 'https://' . $globals->money->paypal_site . '/cgi-bin/webscr';
- $user = S::user();
$roboturl = str_replace("https://","http://",$globals->baseurl)
. '/' . $platal->ns . "payment/paypal_return/" . S::v('uid')
function handlers()
{
return array(
- 'index' => $this->make_hook('index', AUTH_PUBLIC),
- 'cacert.pem' => $this->make_hook('cacert', AUTH_PUBLIC),
- 'changelog' => $this->make_hook('changelog', AUTH_PUBLIC),
+ 'index' => $this->make_hook('index', AUTH_PUBLIC),
+ 'cacert.pem' => $this->make_hook('cacert', AUTH_PUBLIC),
+ 'changelog' => $this->make_hook('changelog', AUTH_PUBLIC),
// Preferences thingies
- 'prefs' => $this->make_hook('prefs', AUTH_COOKIE, 'user,groups'),
- 'prefs/rss' => $this->make_hook('prefs_rss', AUTH_COOKIE, 'user'),
- 'prefs/webredirect' => $this->make_hook('webredir', AUTH_MDP, 'mail'),
- 'prefs/skin' => $this->make_hook('skin', AUTH_COOKIE, 'user'),
+ 'prefs' => $this->make_hook('prefs', AUTH_COOKIE, 'user,groups'),
+ 'prefs/rss' => $this->make_hook('prefs_rss', AUTH_COOKIE, 'user'),
+ 'prefs/webredirect' => $this->make_hook('webredir', AUTH_PASSWD, 'mail'),
+ 'prefs/skin' => $this->make_hook('skin', AUTH_COOKIE, 'user'),
+ 'prefs/email' => $this->make_hook('prefs_email', AUTH_COOKIE, 'mail'),
// password related thingies
- 'password' => $this->make_hook('password', AUTH_MDP, 'user,groups'),
- 'tmpPWD' => $this->make_hook('tmpPWD', AUTH_PUBLIC),
- 'password/smtp' => $this->make_hook('smtppass', AUTH_MDP, 'mail'),
- 'recovery' => $this->make_hook('recovery', AUTH_PUBLIC),
+ 'password' => $this->make_hook('password', AUTH_PASSWD, 'user,groups'),
+ 'password/smtp' => $this->make_hook('smtppass', AUTH_PASSWD, 'mail'),
+ 'tmpPWD' => $this->make_hook('tmpPWD', AUTH_PUBLIC),
+ 'recovery' => $this->make_hook('recovery', AUTH_PUBLIC),
'recovery/ext' => $this->make_hook('recovery_ext', AUTH_PUBLIC),
'register/ext' => $this->make_hook('register_ext', AUTH_PUBLIC),
- 'exit' => $this->make_hook('exit', AUTH_PUBLIC),
- 'review' => $this->make_hook('review', AUTH_PUBLIC),
- 'deconnexion.php' => $this->make_hook('exit', AUTH_PUBLIC),
+ 'exit' => $this->make_hook('exit', AUTH_PUBLIC),
+ 'review' => $this->make_hook('review', AUTH_PUBLIC),
+ 'deconnexion.php' => $this->make_hook('exit', AUTH_PUBLIC),
);
}
}
}
+ function handler_prefs_email($page)
+ {
+ $page->changeTpl('platal/email_preferences.tpl');
+
+ if (Post::has('submit')) {
+ S::assert_xsrf_token();
+
+ $from_email = Post::t('from_email');
+ $from_format = Post::v('from_format');
+
+ // Checks email.
+ $email_regex = '/^[a-z0-9.\-+_\$]+@([\-.+_]?[a-z0-9])+$/i';
+ if (!preg_match($email_regex, $from_email)) {
+ $full_regex = '/^[^<]*<[a-z0-9.\-+_\$]+@([\-.+_]?[a-z0-9])+>$/i';
+ if (!preg_match($full_regex, $from_email)) {
+ $page->trigError("L'adresse email est erronée.");
+ $error = true;
+ $page->assign('from_email', $from_email);
+ $page->assign('from_format', $from_format);
+ $page->assign('error', true);
+ return;
+ }
+ }
+
+ // Saves data.
+ XDB::execute('UPDATE accounts
+ SET from_email = {?}, from_format = {?}
+ WHERE uid = {?}',
+ $from_email, ($from_format == 'html' ? 'html' : 'text'), S::user()->id());
+ $page->trigSuccess('Données enregistrées.');
+ }
+
+ $data = XDB::fetchOneAssoc('SELECT from_email, from_format
+ FROM accounts
+ WHERE uid = {?}',
+ S::user()->id());
+ $page->assign('from_email', $data['from_email']);
+ $page->assign('from_format', $data['from_format']);
+ $page->assign('error', false);
+ }
+
function handler_password($page)
{
global $globals;
$user->id(), $hash);
$mymail = new PlMailer('platal/password_recovery_xnet.mail.tpl');
- $mymail->addTo($user);
+ $mymail->setTo($user);
$mymail->assign('hash', $hash);
$mymail->assign('email', Post::t('login'));
$mymail->send();
XDB::execute('DELETE FROM account_lost_passwords
WHERE DATE_SUB(NOW(), INTERVAL 380 MINUTE) > created');
- $res = XDB::query('SELECT uid
- FROM account_lost_passwords WHERE certificat={?}', $certif);
- $ligne = $res->fetchOneAssoc();
- if (!$ligne) {
- $page->changeTpl('platal/index.tpl');
- $page->kill("Cette adresse n'existe pas ou n'existe plus sur le serveur.");
- }
-
- $uid = $ligne["uid"];
if (Post::has('pwhash') && Post::t('pwhash')) {
+ $uid = XDB::fetchOneCell('SELECT uid
+ FROM accounts
+ WHERE hruid = {?}',
+ Post::t('username'));
$password = Post::t('pwhash');
XDB::query('UPDATE accounts
- SET password={?}
+ SET password = {?}
WHERE uid = {?} AND state = \'active\'',
$password, $uid);
XDB::query('DELETE FROM account_lost_passwords
- WHERE certificat={?}', $certif);
+ WHERE certificat = {?}', $certif);
// If GoogleApps is enabled, and the user did choose to use synchronized passwords,
// updates the Google Apps password as well.
// Try to start a session (so the user don't have to log in); we will use
// the password available in Post:: to authenticate the user.
- Platal::session()->start(AUTH_MDP);
+ Platal::session()->start(AUTH_PASSWD);
$page->changeTpl('platal/tmpPWD.success.tpl');
} else {
+ $res = XDB::query('SELECT uid
+ FROM account_lost_passwords
+ WHERE certificat = {?}', $certif);
+ $ligne = $res->fetchOneAssoc();
+ if (!$ligne) {
+ $page->changeTpl('platal/index.tpl');
+ $page->kill("Cette adresse n'existe pas ou n'existe plus sur le serveur.");
+ }
+
$hruid = XDB::fetchOneCell('SELECT hruid
FROM accounts
WHERE uid = {?}',
- $uid);
+ $ligne['uid']);
$page->changeTpl('platal/password.tpl');
$page->assign('hruid', $hruid);
$page->assign('do_auth', 1);
{
return array(
'photo' => $this->make_hook('photo', AUTH_PUBLIC),
- 'photo/change' => $this->make_hook('photo_change', AUTH_MDP, 'user'),
+ 'photo/change' => $this->make_hook('photo_change', AUTH_PASSWD, 'user'),
'fiche.php' => $this->make_hook('fiche', AUTH_PUBLIC),
'profile' => $this->make_hook('profile', AUTH_PUBLIC),
'profile/private' => $this->make_hook('profile', AUTH_COOKIE, 'user'),
'profile/ax' => $this->make_hook('ax', AUTH_COOKIE, 'admin,edit_directory'),
- 'profile/edit' => $this->make_hook('p_edit', AUTH_MDP, 'user'),
+ 'profile/edit' => $this->make_hook('p_edit', AUTH_PASSWD, 'user'),
'profile/ajax/address' => $this->make_hook('ajax_address', AUTH_COOKIE, 'user', NO_AUTH),
- 'profile/ajax/address/del' => $this->make_hook('ajax_address_del', AUTH_MDP, 'user'),
+ 'profile/ajax/address/del' => $this->make_hook('ajax_address_del', AUTH_PASSWD, 'user'),
'profile/ajax/tel' => $this->make_hook('ajax_tel', AUTH_COOKIE, 'user', NO_AUTH),
'profile/ajax/edu' => $this->make_hook('ajax_edu', AUTH_COOKIE, 'user', NO_AUTH),
'profile/ajax/medal' => $this->make_hook('ajax_medal', AUTH_COOKIE, 'user', NO_AUTH),
'groupes-x/logo' => $this->make_hook('xnetlogo', AUTH_PUBLIC),
'vcard' => $this->make_hook('vcard', AUTH_COOKIE, 'user', NO_HTTPS),
- 'admin/binets' => $this->make_hook('admin_binets', AUTH_MDP, 'admin'),
- 'admin/medals' => $this->make_hook('admin_medals', AUTH_MDP, 'admin'),
- 'admin/education' => $this->make_hook('admin_education', AUTH_MDP, 'admin'),
- 'admin/education_field' => $this->make_hook('admin_education_field', AUTH_MDP, 'admin'),
- 'admin/education_degree' => $this->make_hook('admin_education_degree', AUTH_MDP, 'admin'),
- 'admin/education_degree_set' => $this->make_hook('admin_education_degree_set', AUTH_MDP, 'admin'),
- 'admin/sections' => $this->make_hook('admin_sections', AUTH_MDP, 'admin'),
- 'admin/networking' => $this->make_hook('admin_networking', AUTH_MDP, 'admin'),
- 'admin/trombino' => $this->make_hook('admin_trombino', AUTH_MDP, 'admin'),
- 'admin/corps_enum' => $this->make_hook('admin_corps_enum', AUTH_MDP, 'admin'),
- 'admin/corps_rank' => $this->make_hook('admin_corps_rank', AUTH_MDP, 'admin'),
+ 'admin/binets' => $this->make_hook('admin_binets', AUTH_PASSWD, 'admin'),
+ 'admin/medals' => $this->make_hook('admin_medals', AUTH_PASSWD, 'admin'),
+ 'admin/education' => $this->make_hook('admin_education', AUTH_PASSWD, 'admin'),
+ 'admin/education_field' => $this->make_hook('admin_education_field', AUTH_PASSWD, 'admin'),
+ 'admin/education_degree' => $this->make_hook('admin_education_degree', AUTH_PASSWD, 'admin'),
+ 'admin/education_degree_set' => $this->make_hook('admin_education_degree_set', AUTH_PASSWD, 'admin'),
+ 'admin/sections' => $this->make_hook('admin_sections', AUTH_PASSWD, 'admin'),
+ 'admin/networking' => $this->make_hook('admin_networking', AUTH_PASSWD, 'admin'),
+ 'admin/trombino' => $this->make_hook('admin_trombino', AUTH_PASSWD, 'admin'),
+ 'admin/corps_enum' => $this->make_hook('admin_corps_enum', AUTH_PASSWD, 'admin'),
+ 'admin/corps_rank' => $this->make_hook('admin_corps_rank', AUTH_PASSWD, 'admin'),
);
}
{
global $globals;
- if (in_array($hrpid, array('general', 'adresses', 'emploi', 'poly', 'deco', 'skill', 'mentor', 'deltaten'))) {
+ if (in_array($hrpid, array('general', 'adresses', 'emploi', 'poly', 'deco', 'mentor', 'deltaten'))) {
$aux = $opened_tab;
$opened_tab = $hrpid;
$hrpid = $aux;
}
$wiz->addPage('ProfilePageDecos', 'Décorations - Medailles', 'deco');
if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE)) {
- $wiz->addPage('ProfilePageSkills', 'Compétences diverses', 'skill');
$wiz->addPage('ProfilePageMentor', 'Mentoring', 'mentor');
}
if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE) && $profile->isDeltatenEnabled(Profile::DELTATEN_OLD)) {
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
+class ProfileSettingSkill implements ProfileSetting
+{
+ private $table;
+ private $id;
+ private $skill_field;
+ private $text_field;
+
+ public function __construct($table, $id, $skill, $text)
+ {
+ $this->table = $table;
+ $this->id = $id;
+ $this->skill_field = $skill;
+ $this->text_field = $text;
+ }
+
+ public function value(ProfilePage $page, $field, $value, &$success)
+ {
+ if (is_null($value)) {
+ $value = array();
+ $res = XDB::iterRow("SELECT s.{$this->id}, s.{$this->text_field}, i.level
+ FROM profile_{$this->table}_enum AS s
+ INNER JOIN profile_{$this->table}s AS i ON (s.{$this->id} = i.{$this->skill_field})
+ WHERE i.pid = {?}",
+ $page->pid());
+ while (list($sid, $text, $level) = $res->next()) {
+ $value[$sid] = array('text' => $text, 'level' => $level);
+ }
+ }
+ if (!is_array($value)) {
+ $value = array();
+ } else {
+ foreach ($value as $id=>&$skill) {
+ if (!isset($skill['text']) || empty($skill['text'])) {
+ $res = XDB::query("SELECT {$this->text_field}
+ FROM profile_{$this->table}_enum
+ WHERE {$this->id} = {?}", $id);
+ $skill['text'] = $res->fetchOneCell();
+ }
+ }
+ }
+ ksort($value);
+ $success = true;
+ return $value;
+ }
+
+ public function save(ProfilePage $page, $field, $value)
+ {
+ XDB::execute("DELETE FROM profile_{$this->table}s
+ WHERE pid = {?}",
+ $page->pid());
+ if (!count($value)) {
+ return;
+ }
+ foreach ($value as $id=>&$skill) {
+ XDB::execute("INSERT INTO profile_{$this->table}s (pid, {$this->skill_field}, level)
+ VALUES ({?}, {?}, {?})",
+ $page->pid(), $id, $skill['level']);
+ }
+ }
+
+ public function getText($value) {
+ $skills = array();
+
+ if ($this->table == 'langskill') {
+ static $levels = array(
+ 1 => 'connaissance basique',
+ 2 => 'maîtrise des bases',
+ 3 => 'maîtrise limitée',
+ 4 => 'maîtrise générale',
+ 5 => 'bonne maîtrise',
+ 6 => 'maîtrise complète'
+ );
+ foreach ($value as $skill) {
+ $skills[] = $skill['text'] . ' (' . $levels[$skill['level']] . ')';
+ }
+ } else {
+ foreach ($value as $skill) {
+ $skills[] = $skill['text'] . ' (' . $skill['level'] . ')';
+ }
+ }
+
+ return implode(', ' , $skills);
+ }
+}
+
/** Terms associated to profile mentoring */
class ProfileSettingTerms implements ProfileSetting
{
$this->settings['expertise'] = null;
$this->settings['terms'] = new ProfileSettingTerms();
$this->settings['countries'] = new ProfileSettingCountry();
+ $this->settings['competences'] = new ProfileSettingSkill('skill', 'id', 'cid', 'text_fr');
+ $this->settings['langues'] = new ProfileSettingSkill('langskill', 'iso_639_2b', 'lid', 'language');
}
protected function _fetchData()
FROM geoloc_countries
ORDER BY country"));
$page->assign('hrpid', $this->profile->hrpid);
+ $page->assign('comp_list', XDB::iterator("SELECT id, text_fr, FIND_IN_SET('titre',flags) AS title
+ FROM profile_skill_enum"));
+ $page->assign('comp_level', array('initié' => 'initié',
+ 'bonne connaissance' => 'bonne connaissance',
+ 'expert' => 'expert'));
+ $page->assign('lang_list', XDB::iterator('SELECT iso_639_2b, language
+ FROM profile_langskill_enum
+ ORDER BY language'));
+ $page->assign('lang_level', array(1 => 'connaissance basique',
+ 2 => 'maîtrise des bases',
+ 3 => 'maîtrise limitée',
+ 4 => 'maîtrise générale',
+ 5 => 'bonne maîtrise',
+ 6 => 'maîtrise complète'));
}
}
require_once dirname(__FILE__) . '/groups.inc.php';
require_once dirname(__FILE__) . '/decos.inc.php';
require_once dirname(__FILE__) . '/jobs.inc.php';
-require_once dirname(__FILE__) . '/skills.inc.php';
require_once dirname(__FILE__) . '/mentor.inc.php';
require_once dirname(__FILE__) . '/deltaten.inc.php';
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2011 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 *
- ***************************************************************************/
-
-class ProfileSettingSkill implements ProfileSetting
-{
- private $table;
- private $id;
- private $skill_field;
- private $text_field;
-
- public function __construct($table, $id, $skill, $text)
- {
- $this->table = $table;
- $this->id = $id;
- $this->skill_field = $skill;
- $this->text_field = $text;
- }
-
- public function value(ProfilePage $page, $field, $value, &$success)
- {
- if (is_null($value)) {
- $value = array();
- $res = XDB::iterRow("SELECT s.{$this->id}, s.{$this->text_field}, i.level
- FROM profile_{$this->table}_enum AS s
- INNER JOIN profile_{$this->table}s AS i ON (s.{$this->id} = i.{$this->skill_field})
- WHERE i.pid = {?}",
- $page->pid());
- while (list($sid, $text, $level) = $res->next()) {
- $value[$sid] = array('text' => $text, 'level' => $level);
- }
- }
- if (!is_array($value)) {
- $value = array();
- } else {
- foreach ($value as $id=>&$skill) {
- if (!isset($skill['text']) || empty($skill['text'])) {
- $res = XDB::query("SELECT {$this->text_field}
- FROM profile_{$this->table}_enum
- WHERE {$this->id} = {?}", $id);
- $skill['text'] = $res->fetchOneCell();
- }
- }
- }
- ksort($value);
- $success = true;
- return $value;
- }
-
- public function save(ProfilePage $page, $field, $value)
- {
- XDB::execute("DELETE FROM profile_{$this->table}s
- WHERE pid = {?}",
- $page->pid());
- if (!count($value)) {
- return;
- }
- foreach ($value as $id=>&$skill) {
- XDB::execute("INSERT INTO profile_{$this->table}s (pid, {$this->skill_field}, level)
- VALUES ({?}, {?}, {?})",
- $page->pid(), $id, $skill['level']);
- }
- }
-
- public function getText($value) {
- $skills = array();
-
- if ($this->table == 'langskill') {
- static $levels = array(
- 1 => 'connaissance basique',
- 2 => 'maîtrise des bases',
- 3 => 'maîtrise limitée',
- 4 => 'maîtrise générale',
- 5 => 'bonne maîtrise',
- 6 => 'maîtrise complète'
- );
- foreach ($value as $skill) {
- $skills[] = $skill['text'] . ' (' . $levels[$skill['level']] . ')';
- }
- } else {
- foreach ($value as $skill) {
- $skills[] = $skill['text'] . ' (' . $skill['level'] . ')';
- }
- }
-
- return implode(', ' , $skills);
- }
-}
-
-class ProfilePageSkills extends ProfilePage
-{
- protected $pg_template = 'profile/skill.tpl';
-
- public function __construct(PlWizard $wiz)
- {
- parent::__construct($wiz);
- $this->settings['competences'] = new ProfileSettingSkill('skill', 'id', 'cid', 'text_fr');
- $this->settings['langues'] = new ProfileSettingSkill('langskill', 'iso_639_2b', 'lid', 'language');
- }
-
- public function _prepare(PlPage $page, $id)
- {
- $page->assign('comp_list', XDB::iterator("SELECT id, text_fr, FIND_IN_SET('titre',flags) AS title
- FROM profile_skill_enum"));
- $page->assign('comp_level', array('initié' => 'initié',
- 'bonne connaissance' => 'bonne connaissance',
- 'expert' => 'expert'));
- $page->assign('lang_list', XDB::iterator('SELECT iso_639_2b, language
- FROM profile_langskill_enum
- ORDER BY language'));
- $page->assign('lang_level', array(1 => 'connaissance basique',
- 2 => 'maîtrise des bases',
- 3 => 'maîtrise limitée',
- 4 => 'maîtrise générale',
- 5 => 'bonne maîtrise',
- 6 => 'maîtrise complète'));
- }
-}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
-?>
// Try to start a session (so the user don't have to log in); we will use
// the password available in Post:: to authenticate the user.
- Platal::session()->start(AUTH_MDP);
+ Platal::session()->start(AUTH_PASSWD);
// Subscribe the user to the services she did request at registration time.
require_once 'newsletter.inc.php';
'survey/result' => $this->make_hook('result', AUTH_PUBLIC),
'survey/edit' => $this->make_hook('edit', AUTH_COOKIE, 'user'),
'survey/ajax' => $this->make_hook('ajax', AUTH_COOKIE, 'user'),
- 'survey/admin' => $this->make_hook('admin', AUTH_MDP, 'admin'),
- 'survey/admin/edit' => $this->make_hook('adminEdit', AUTH_MDP, 'admin'),
- 'survey/admin/valid' => $this->make_hook('adminValidate', AUTH_MDP, 'admin'),
- 'survey/admin/del' => $this->make_hook('adminDelete', AUTH_MDP, 'admin'),
+ 'survey/admin' => $this->make_hook('admin', AUTH_PASSWD, 'admin'),
+ 'survey/admin/edit' => $this->make_hook('adminEdit', AUTH_PASSWD, 'admin'),
+ 'survey/admin/valid' => $this->make_hook('adminValidate', AUTH_PASSWD, 'admin'),
+ 'survey/admin/del' => $this->make_hook('adminDelete', AUTH_PASSWD, 'admin'),
);
}
// }}}
{
return array(
'url' => $this->make_hook('url', AUTH_PUBLIC),
- 'admin/url' => $this->make_hook('admin_url', AUTH_MDP, 'admin')
+ 'admin/url' => $this->make_hook('admin_url', AUTH_PASSWD, 'admin')
);
}
'index' => $this->make_hook('index', AUTH_PUBLIC),
'exit' => $this->make_hook('exit', AUTH_PUBLIC),
- 'admin' => $this->make_hook('admin', AUTH_MDP, 'admin'),
+ 'admin' => $this->make_hook('admin', AUTH_PASSWD, 'admin'),
'groups' => $this->make_hook('groups', AUTH_PUBLIC),
'groupes.php' => $this->make_hook('groups2', AUTH_PUBLIC),
'plan' => $this->make_hook('plan', AUTH_PUBLIC),
// Should be removed in a future release as links will have expired anyway.
'register/ext' => $this->make_hook('register_ext', AUTH_PUBLIC),
- 'photo' => $this->make_hook('photo', AUTH_MDP, 'groups'),
- 'autologin' => $this->make_hook('autologin', AUTH_MDP, 'groups'),
- 'edit' => $this->make_hook('edit', AUTH_MDP, 'groups'),
+ 'photo' => $this->make_hook('photo', AUTH_PASSWD, 'groups'),
+ 'autologin' => $this->make_hook('autologin', AUTH_PASSWD, 'groups'),
+ 'edit' => $this->make_hook('edit', AUTH_PASSWD, 'groups'),
'Xnet' => $this->make_wiki_hook(),
);
}
function handlers()
{
return array(
- '%grp/events' => $this->make_hook('events', AUTH_MDP, 'groups'),
- '%grp/events/sub' => $this->make_hook('sub', AUTH_MDP, 'groups'),
- '%grp/events/csv' => $this->make_hook('csv', AUTH_MDP, 'groups', NO_HTTPS),
- '%grp/events/ical' => $this->make_hook('ical', AUTH_MDP, 'groups', NO_HTTPS),
- '%grp/events/edit' => $this->make_hook('edit', AUTH_MDP, 'groupadmin'),
- '%grp/events/admin' => $this->make_hook('admin', AUTH_MDP, 'groupmember'),
+ '%grp/events' => $this->make_hook('events', AUTH_PASSWD, 'groups'),
+ '%grp/events/sub' => $this->make_hook('sub', AUTH_PASSWD, 'groups'),
+ '%grp/events/csv' => $this->make_hook('csv', AUTH_PASSWD, 'groups', NO_HTTPS),
+ '%grp/events/ical' => $this->make_hook('ical', AUTH_PASSWD, 'groups', NO_HTTPS),
+ '%grp/events/edit' => $this->make_hook('edit', AUTH_PASSWD, 'groupadmin'),
+ '%grp/events/admin' => $this->make_hook('admin', AUTH_PASSWD, 'groupmember'),
);
}
Post::v('intitule')." - ".$globals->asso('nom'),
Post::v('site'), $money_defaut,
Post::v('confirmation'), 0, 999,
- $globals->asso('id'), $eid, Post::b('donation'));
+ $globals->asso('id'), $eid, Post::v('payment_public') == 'yes');
if ($p->accept()) {
$p->submit();
} else {
}
// get a list of all the payment for this asso
- $res = XDB::iterator("SELECT id, text
- FROM payments
- WHERE asso_id = {?}", $globals->asso('id'));
+ $res = XDB::iterator("SELECT id, text
+ FROM payments
+ WHERE asso_id = {?} AND NOT FIND_IN_SET('old', flags)",
+ $globals->asso('id'));
$paiements = array();
while ($a = $res->next()) $paiements[$a['id']] = $a['text']; {
$page->assign('paiements', $paiements);
// if we have a first new short_name create the lists
$lastid = array();
$where = array(
- $globals->xnet->participant_list => 'nb > 0',
- $globals->xnet->payed_list => 'paid > 0',
- $globals->xnet->unpayed_list => 'nb > 0 AND paid = 0'
+ $globals->xnet->participant_list => 'g.nb > 0',
+ $globals->xnet->payed_list => '(g.paid > 0 OR p.amount > 0)',
+ $globals->xnet->unpayed_list => 'g.nb > 0 AND g.paid = 0 AND p.amount IS NULL'
);
foreach (array($globals->xnet->participant_list, $globals->xnet->payed_list, $globals->xnet->unpayed_list) as $suffix) {
- $uids = XDB::fetchColumn('SELECT uid
- FROM group_event_participants
- WHERE eid = {?} AND ' . $where[$suffix],
+ $uids = XDB::fetchColumn('SELECT g.uid
+ FROM group_event_participants AS g
+ INNER JOIN group_events AS e ON (g.eid = e.eid)
+ LEFT JOIN payment_transactions AS p ON (e.paiement_id = p.ref AND g.uid = p.uid)
+ WHERE g.eid = {?} AND ' . $where[$suffix],
$eid);
foreach ($uids as $uid) {
add_to_list_alias($uid, $new . $suffix, $globals->xnet->evts_domain, 'event');
}
}
+
$uids = XDB::fetchColumn('SELECT m.uid
FROM group_members AS m
LEFT JOIN group_event_participants AS e ON (e.uid = m.uid AND e.eid = {?})
'%grp/asso.php' => $this->make_hook('index', AUTH_PUBLIC),
'%grp/logo' => $this->make_hook('logo', AUTH_PUBLIC),
'%grp/site' => $this->make_hook('site', AUTH_PUBLIC),
- '%grp/edit' => $this->make_hook('edit', AUTH_MDP, 'groupadmin'),
- '%grp/mail' => $this->make_hook('mail', AUTH_MDP, 'groupadmin'),
- '%grp/forum' => $this->make_hook('forum', AUTH_MDP, 'groupmember'),
- '%grp/former_users' => $this->make_hook('former_users', AUTH_MDP, 'admin'),
- '%grp/annuaire' => $this->make_hook('annuaire', AUTH_MDP, 'groupannu'),
- '%grp/annuaire/vcard' => $this->make_hook('vcard', AUTH_MDP, 'groupmember:groupannu'),
- '%grp/annuaire/csv' => $this->make_hook('csv', AUTH_MDP, 'groupmember:groupannu'),
- '%grp/directory/sync' => $this->make_hook('directory_sync', AUTH_MDP, 'groupadmin'),
- '%grp/directory/unact' => $this->make_hook('non_active', AUTH_MDP, 'groupadmin'),
- '%grp/trombi' => $this->make_hook('trombi', AUTH_MDP, 'groupannu'),
- '%grp/geoloc' => $this->make_hook('geoloc', AUTH_MDP, 'groupannu'),
- '%grp/subscribe' => $this->make_hook('subscribe', AUTH_MDP, 'groups'),
- '%grp/subscribe/valid' => $this->make_hook('subscribe_valid', AUTH_MDP, 'groupadmin'),
- '%grp/unsubscribe' => $this->make_hook('unsubscribe', AUTH_MDP, 'groupmember'),
-
- '%grp/change_rights' => $this->make_hook('change_rights', AUTH_MDP, 'groups'),
- '%grp/admin/annuaire' => $this->make_hook('admin_annuaire', AUTH_MDP, 'groupadmin'),
- '%grp/member' => $this->make_hook('admin_member', AUTH_MDP, 'groupadmin'),
- '%grp/member/new' => $this->make_hook('admin_member_new', AUTH_MDP, 'groupadmin'),
- '%grp/member/new/ajax' => $this->make_hook('admin_member_new_ajax', AUTH_MDP, 'groups', NO_AUTH),
- '%grp/member/del' => $this->make_hook('admin_member_del', AUTH_MDP, 'groupadmin'),
- '%grp/member/suggest' => $this->make_hook('admin_member_suggest', AUTH_MDP, 'groupadmin'),
+ '%grp/edit' => $this->make_hook('edit', AUTH_PASSWD, 'groupadmin'),
+ '%grp/mail' => $this->make_hook('mail', AUTH_PASSWD, 'groupadmin'),
+ '%grp/forum' => $this->make_hook('forum', AUTH_PASSWD, 'groupmember'),
+ '%grp/former_users' => $this->make_hook('former_users', AUTH_PASSWD, 'admin'),
+ '%grp/annuaire' => $this->make_hook('annuaire', AUTH_PASSWD, 'groupannu'),
+ '%grp/annuaire/vcard' => $this->make_hook('vcard', AUTH_PASSWD, 'groupmember:groupannu'),
+ '%grp/annuaire/csv' => $this->make_hook('csv', AUTH_PASSWD, 'groupmember:groupannu'),
+ '%grp/directory/sync' => $this->make_hook('directory_sync', AUTH_PASSWD, 'groupadmin'),
+ '%grp/directory/unact' => $this->make_hook('non_active', AUTH_PASSWD, 'groupadmin'),
+ '%grp/trombi' => $this->make_hook('trombi', AUTH_PASSWD, 'groupannu'),
+ '%grp/geoloc' => $this->make_hook('geoloc', AUTH_PASSWD, 'groupannu'),
+ '%grp/subscribe' => $this->make_hook('subscribe', AUTH_PASSWD, 'groups'),
+ '%grp/subscribe/valid' => $this->make_hook('subscribe_valid', AUTH_PASSWD, 'groupadmin'),
+ '%grp/unsubscribe' => $this->make_hook('unsubscribe', AUTH_PASSWD, 'groupmember'),
+
+ '%grp/change_rights' => $this->make_hook('change_rights', AUTH_PASSWD, 'groups'),
+ '%grp/admin/annuaire' => $this->make_hook('admin_annuaire', AUTH_PASSWD, 'groupadmin'),
+ '%grp/member' => $this->make_hook('admin_member', AUTH_PASSWD, 'groupadmin'),
+ '%grp/member/new' => $this->make_hook('admin_member_new', AUTH_PASSWD, 'groupadmin'),
+ '%grp/member/new/ajax' => $this->make_hook('admin_member_new_ajax', AUTH_PASSWD, 'groups', NO_AUTH),
+ '%grp/member/del' => $this->make_hook('admin_member_del', AUTH_PASSWD, 'groupadmin'),
+ '%grp/member/suggest' => $this->make_hook('admin_member_suggest', AUTH_PASSWD, 'groupadmin'),
'%grp/rss' => $this->make_token_hook('rss', AUTH_PUBLIC),
- '%grp/announce/new' => $this->make_hook('edit_announce', AUTH_MDP, 'groupadmin'),
- '%grp/announce/edit' => $this->make_hook('edit_announce', AUTH_MDP, 'groupadmin'),
+ '%grp/announce/new' => $this->make_hook('edit_announce', AUTH_PASSWD, 'groupadmin'),
+ '%grp/announce/edit' => $this->make_hook('edit_announce', AUTH_PASSWD, 'groupadmin'),
'%grp/announce/photo' => $this->make_hook('photo_announce', AUTH_PUBLIC),
- '%grp/admin/announces' => $this->make_hook('admin_announce', AUTH_MDP, 'groupadmin'),
+ '%grp/admin/announces' => $this->make_hook('admin_announce', AUTH_PASSWD, 'groupadmin'),
);
}
WHERE asso_id = {?} AND expiration >= CURRENT_DATE()
AND FIND_IN_SET('public', flags)",
$globals->asso('id'));
+ $payments = XDB::fetchAllAssoc("SELECT id, text
+ FROM payments
+ WHERE asso_id = {?} AND NOT FIND_IN_SET('old', flags) AND FIND_IN_SET('public', flags)
+ ORDER BY id DESC",
+ $globals->asso('id'));
+ $page->assign('payments', $payments);
}
if (may_update()) {
$subs_valid = XDB::query("SELECT uid
{
global $globals;
$page->changeTpl('xnetgrp/edit.tpl');
+ $error = false;
+
+ if (S::admin()) {
+ $domains = XDB::iterator('SELECT *
+ FROM group_dom
+ ORDER BY nom');
+ $page->assign('domains', $domains);
+ $page->assign('super', true);
+ }
if (Post::has('submit')) {
S::assert_xsrf_token();
if (Post::v('mail_domain') && (strstr(Post::v('mail_domain'), '.') === false)) {
$page->trigError('Le domaine doit être un FQDN (aucune modification effectuée) !!!');
- return;
+ $error = true;
}
if (Post::t('nom') == '' || Post::t('diminutif') == '') {
$page->trigError('Ni le nom ni le diminutif du groupe ne peuvent être vide.');
+ $error = true;
+ }
+ if ($error) {
+ $page->assign('nom', Post::t('nom'));
+ $page->assign('diminutif', Post::t('diminutif'));
+ $page->assign('mail_domain', Post::t('mail_domain'));
+ $page->assign('cat', Post::v('cat'));
+ $page->assign('dom', Post::v('dom'));
+ $page->assign('ax', Post::v('ax'));
+ $page->assign('axDate', Post::t('axDate'));
+ $page->assign('site', $site);
+ $page->assign('resp', Post::t('resp'));
+ $page->assign('mail', Post::t('mail'));
+ $page->assign('phone', Post::t('phone'));
+ $page->assign('fax', Post::t('fax'));
+ $page->assign('address', Post::t('address'));
+ $page->assign('forum', Post::t('forum'));
+ $page->assign('inscriptible', Post::v('inscriptible'));
+ $page->assign('sub_url', Post::t('sub_url'));
+ $page->assign('unsub_url', Post::t('unsub_url'));
+ $page->assign('welcome_msg', Post::t('welcome_msg'));
+ $page->assign('pub', Post::v('pub'));
+ $page->assign('notif_unsub', Post::i('notif_unsub'));
+ $page->assign('descr', Post::t('descr'));
+ $page->assign('error', $error);
return;
}
+
$axDate = make_datetime(Post::v('axDate'));
if (Post::t('axDate') != '') {
$axDate = make_datetime(Post::v('axDate'))->format('Y-m-d');
pl_redirect('../' . Post::v('diminutif', $globals->asso('diminutif')) . '/edit');
}
-
- if (S::admin()) {
- $dom = XDB::iterator('SELECT *
- FROM group_dom
- ORDER BY nom');
- $page->assign('dom', $dom);
- $page->assign('super', true);
- }
+ $page->assign('error', $error);
+ $page->assign('cat', $globals->asso('cat'));
+ $page->assign('dom', $globals->asso('dom'));
+ $page->assign('ax', $globals->asso('ax'));
+ $page->assign('inscriptible', $globals->asso('inscriptible'));
+ $page->assign('pub', $globals->asso('pub'));
+ $page->assign('notif_unsub', $globals->asso('notif_unsub'));
}
function handler_mail($page)
}
}
} else {
- // User is of type xnet. There are 3 possible cases:
- // * the email is not known yet: we create a new account and
- // propose to send an email to the user so he can activate
- // his account,
- // * the email is known but the user was not contacted in order to
- // activate yet: we propose to send an email to the user so he
- // can activate his account,
- // * the email is known and the user was already contacted or has
- // an active account: nothing to be done.
- list($mbox, $domain) = explode('@', strtolower($email));
- $hruid = User::makeHrid($mbox, $domain, 'ext');
- // User might already have an account (in another group for example).
- $user = User::getSilent($hruid);
-
- // If the user has no account yet, creates new account: build names from email address.
- if (empty($user)) {
- $parts = explode('.', $mbox);
- if (count($parts) == 1) {
- $lastname = $display_name = $full_name = $directory_name = ucfirst($mbox);
- $firstname = '';
- } else {
- $firstname = ucfirst($parts[0]);
- $lastname = ucwords(implode(' ', array_slice($parts, 1)));
- $display_name = $firstname;
- $full_name = "$firstname $lastname";
- $directory_name = strtoupper($lastname) . " " . $firstname;
- }
- XDB::execute('INSERT INTO accounts (hruid, display_name, full_name, directory_name, firstname, lastname, email, type, state)
- VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, \'xnet\', \'disabled\')',
- $hruid, $display_name, $full_name, $directory_name, $firstname, $lastname, $email);
+ // Check if the email is a redirection.
+ $user = User::getSilent($email);
+
+ if (is_null($user) || $user->type == 'xnet') {
+ // User is of type xnet. There are 3 possible cases:
+ // * the email is not known yet: we create a new account and
+ // propose to send an email to the user so he can activate
+ // his account,
+ // * the email is known but the user was not contacted in order to
+ // activate yet: we propose to send an email to the user so he
+ // can activate his account,
+ // * the email is known and the user was already contacted or has
+ // an active account: nothing to be done.
+ list($mbox, $domain) = explode('@', strtolower($email));
+ $hruid = User::makeHrid($mbox, $domain, 'ext');
+ // User might already have an account (in another group for example).
$user = User::getSilent($hruid);
- }
- $suggest_account_activation = $this->suggest($user);
+ // If the user has no account yet, creates new account: build names from email address.
+ if (empty($user)) {
+ $parts = explode('.', $mbox);
+ if (count($parts) == 1) {
+ $lastname = $display_name = $full_name = $directory_name = ucfirst($mbox);
+ $firstname = '';
+ } else {
+ $firstname = ucfirst($parts[0]);
+ $lastname = ucwords(implode(' ', array_slice($parts, 1)));
+ $display_name = $firstname;
+ $full_name = "$firstname $lastname";
+ $directory_name = strtoupper($lastname) . " " . $firstname;
+ }
+ XDB::execute('INSERT INTO accounts (hruid, display_name, full_name, directory_name, firstname, lastname, email, type, state)
+ VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, \'xnet\', \'disabled\')',
+ $hruid, $display_name, $full_name, $directory_name, $firstname, $lastname, $email);
+ $user = User::getSilent($hruid);
+ }
+
+ $suggest_account_activation = $this->suggest($user);
+ }
}
if ($user) {
$page->trigSuccess('Données de l\'utilisateur mises à jour.');
}
- if (($user->type == 'xnet' && !$user->perms) && Post::b('suggest')) {
- $request = new AccountReq(S::user(), $user->hruid, Post::t('email'), $globals->asso('nom'));
- $request->submit();
- $page->trigSuccess('Le compte va bientôt être activé.');
+ if (($user->type == 'xnet' && !$user->perms)) {
+ if (Post::b('suggest')) {
+ $request = new AccountReq(S::user(), $user->hruid, Post::t('email'), $globals->asso('nom'));
+ $request->submit();
+ $page->trigSuccess('Le compte va bientôt être activé.');
+ }
+ if (Post::b('again')) {
+ $data = XDB::fetchOneAssoc('SELECT hash, group_name, sender_name, email
+ FROM register_pending_xnet
+ WHERE uid = {?}',
+ $user->id());
+
+ $mailer = new PlMailer('xnet/account.mail.tpl');
+ $mailer->addCc('validation+xnet_account@polytechnique.org');
+ $mailer->setTo($data['email']);
+ $mailer->assign('hash', $data['hash']);
+ $mailer->assign('email', $data['email']);
+ $mailer->assign('group', $data['group_name']);
+ $mailer->assign('sender_name', $data['sender_name']);
+ $mailer->assign('again', true);
+ $mailer->send();
+ $page->trigSuccess('Relance effectuée avec succès.');
+ }
}
// Update group params for user
if (Post::i('newsletter') == 1) {
$nl->subscribe($user);
} else {
- $nl->unsubscribe(null, $user->id);
+ $nl->unsubscribe(null, $user->id());
}
}
}
$page->assign('alias', $user->emailGroupAliases($globals->asso('mail_domain')));
$page->assign('positions', explode(',', $positions));
$page->assign('nl_registered', $nl_registered);
+ $page->assign('pending_xnet_account', XDB::fetchOneCell('SELECT 1
+ FROM register_pending_xnet
+ WHERE uid = {?}',
+ $user->id()));
}
function handler_rss(PlPage $page, PlUser $user)
function handlers()
{
return array(
- '%grp/lists' => $this->make_hook('lists', AUTH_MDP, 'groupmember'),
- '%grp/lists/create' => $this->make_hook('create', AUTH_MDP, 'groupmember'),
+ '%grp/lists' => $this->make_hook('lists', AUTH_PASSWD, 'groupmember'),
+ '%grp/lists/create' => $this->make_hook('create', AUTH_PASSWD, 'groupmember'),
'%grp/lists/members' => $this->make_hook('members', AUTH_COOKIE, 'groups'),
'%grp/lists/csv' => $this->make_hook('csv', AUTH_COOKIE, 'groups'),
'%grp/lists/archives' => $this->make_hook('archives', AUTH_COOKIE, 'groups'),
'%grp/lists/archives/rss' => $this->make_hook('rss', AUTH_PUBLIC),
- '%grp/lists/moderate' => $this->make_hook('moderate', AUTH_MDP, 'groups'),
- '%grp/lists/admin' => $this->make_hook('admin', AUTH_MDP, 'groups'),
- '%grp/lists/options' => $this->make_hook('options', AUTH_MDP, 'groups'),
- '%grp/lists/delete' => $this->make_hook('delete', AUTH_MDP, 'groups'),
+ '%grp/lists/moderate' => $this->make_hook('moderate', AUTH_PASSWD, 'groups'),
+ '%grp/lists/admin' => $this->make_hook('admin', AUTH_PASSWD, 'groups'),
+ '%grp/lists/options' => $this->make_hook('options', AUTH_PASSWD, 'groups'),
+ '%grp/lists/delete' => $this->make_hook('delete', AUTH_PASSWD, 'groups'),
- '%grp/lists/soptions' => $this->make_hook('soptions', AUTH_MDP, 'groups'),
- '%grp/lists/check' => $this->make_hook('check', AUTH_MDP, 'groups'),
- '%grp/lists/sync' => $this->make_hook('sync', AUTH_MDP, 'groups'),
+ '%grp/lists/soptions' => $this->make_hook('soptions', AUTH_PASSWD, 'groups'),
+ '%grp/lists/check' => $this->make_hook('check', AUTH_PASSWD, 'groups'),
+ '%grp/lists/sync' => $this->make_hook('sync', AUTH_PASSWD, 'groups'),
- '%grp/alias/admin' => $this->make_hook('aadmin', AUTH_MDP, 'groupadmin'),
- '%grp/alias/create' => $this->make_hook('acreate', AUTH_MDP, 'groupadmin'),
+ '%grp/alias/admin' => $this->make_hook('aadmin', AUTH_PASSWD, 'groupadmin'),
+ '%grp/alias/create' => $this->make_hook('acreate', AUTH_PASSWD, 'groupadmin'),
/* hack: lists uses that */
'profile' => $this->make_hook('profile', AUTH_PUBLIC),
function handlers()
{
return array(
- '%grp/nl' => $this->make_hook('nl', AUTH_MDP, 'groups'),
- '%grp/nl/show' => $this->make_hook('nl_show', AUTH_MDP, 'groups'),
- '%grp/nl/search' => $this->make_hook('nl_search', AUTH_MDP, 'groups'),
- '%grp/admin/nl' => $this->make_hook('admin_nl', AUTH_MDP, 'groupadmin'),
- '%grp/admin/nl/sync' => $this->make_hook('admin_nl_sync', AUTH_MDP, 'groupadmin'),
- '%grp/admin/nl/enable' => $this->make_hook('admin_nl_enable', AUTH_MDP, 'groupadmin'),
- '%grp/admin/nl/edit' => $this->make_hook('admin_nl_edit', AUTH_MDP, 'groupadmin'),
- '%grp/admin/nl/edit/cancel' => $this->make_hook('admin_nl_cancel', AUTH_MDP, 'groupadmin'),
- '%grp/admin/nl/edit/valid' => $this->make_hook('admin_nl_valid', AUTH_MDP, 'groupadmin'),
- '%grp/admin/nl/categories' => $this->make_hook('admin_nl_cat', AUTH_MDP, 'groupadmin'),
+ '%grp/nl' => $this->make_hook('nl', AUTH_PASSWD, 'groups'),
+ '%grp/nl/show' => $this->make_hook('nl_show', AUTH_PASSWD, 'groups'),
+ '%grp/nl/search' => $this->make_hook('nl_search', AUTH_PASSWD, 'groups'),
+ '%grp/admin/nl' => $this->make_hook('admin_nl', AUTH_PASSWD, 'groupadmin'),
+ '%grp/admin/nl/sync' => $this->make_hook('admin_nl_sync', AUTH_PASSWD, 'groupadmin'),
+ '%grp/admin/nl/enable' => $this->make_hook('admin_nl_enable', AUTH_PASSWD, 'groupadmin'),
+ '%grp/admin/nl/edit' => $this->make_hook('admin_nl_edit', AUTH_PASSWD, 'groupadmin'),
+ '%grp/admin/nl/edit/cancel' => $this->make_hook('admin_nl_cancel', AUTH_PASSWD, 'groupadmin'),
+ '%grp/admin/nl/edit/valid' => $this->make_hook('admin_nl_valid', AUTH_PASSWD, 'groupadmin'),
+ '%grp/admin/nl/categories' => $this->make_hook('admin_nl_cat', AUTH_PASSWD, 'groupadmin'),
);
}
$with_link = $params->b('link', true);
$with_dir = $params->b('directory', true);
$with_groupperms = $params->b('groupperms', true);
- $raw = $params->b('raw', true);
+ $raw = $params->b('raw', false);
$user = $params->v('user');
if (is_int($user) || ctype_digit($user)) {
$user = User::getWithUID($user);
{foreach from=$cat.users item=user}
{assign var=profile value=$user->profile()}
+{if !$profile->isDead()}
* Le {$cat.operation->getDate($user)|date_format:"%d %B %Y"}, [[https://www.polytechnique.org/profile/private/{$profile->hrid()}|{$profile->fullname(true)}]]
+{/if}
{/foreach}
{/foreach}
}
}
+ function toggleWiki()
+ {
+ if ($('[name="wiki"]').val() == 'text') {
+ $('[name="wiki"]').val('wiki');
+ } else {
+ $('[name="wiki"]').val('text');
+ }
+ }
+
$(window).unload(
function() {
if (sent) {
<td class="titre">de :</td>
<td>
<input type='hidden' name='signature' value='1' />
- <input type='text' name='from' size='60' value='{if $smarty.request.from}
-{$smarty.request.from}
-{else}
-"{$user->fullName()}" <{$user->bestEmail()}>
-{/if}' />
+ <input type='text' name='from' size='60'
+ value="{if $smarty.request.from}{$smarty.request.from}{else}{$preferences.from_email}{/if}" />
</td>
</tr>
<tr>
<legend>Sujet : <input type='text' name='sujet' size='60' value="{$smarty.request.sujet}" /></legend>
<div class="center">
Tu peux utiliser des <a href="wiki_help" class="popup3">{icon name=information title="Syntaxe wiki"} marqueurs wiki</a> pour formatter ton texte.<br />
- <small><label><input type="checkbox" name="nowiki" value="1" {if $smarty.request.nowiki}checked="checked"{/if} onchange="updateWikiView(this);" />
- coche cette case pour envoyer l'email en texte brut, sans formattage</label></small>
+ <small><label>
+ <input type="hidden" name="wiki" value="{$smarty.request.wiki|default:$preferences.from_format}" />
+ <input type="checkbox" {if $smarty.request.wiki eq "text" || (!$smarty.request.wiki && $preferences.from_format eq "text")}checked="checked"{/if}
+ onchange="updateWikiView(this); toggleWiki();" />
+ coche cette case pour envoyer l'email en texte brut, sans formattage
+ </label></small>
</div>
<div id="preview">
<div id="preview_pv" style="display: none">
<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}" />)
+<br />
+<strong>Public :</strong>
+<label><input type="radio" name="pay_public" value="no" {if !t($valid->public)}checked="checked"{/if} />Non</label>
+ -
+<label>Oui<input type="radio" name="pay_public" value="yes" {if t($valid->public)}checked="checked"{/if} /></label><br />
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
</tr>
{/if}
{/if}
+<tr class="pair">
+ <td class="titre">Public :</td>
+ <td>{if $valid->public}Oui{else}Non{/if}</td>
+</tr>
+
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
</table>
{if $nl->mayEdit()}
-<p>Il y a actuellement {$nl->subscriberCount()} inscrits aux envois.</p>
+<p>Il y a actuellement {$nl->subscriberCount()} inscrits aux envois, parmi lesquels {$nl->lostSubscriberCount()} n'ont aucune redirection active.</p>
{/if}
{* *}
{**************************************************************************}
+{if $smarty.request.op eq "submit" and !$pl_errors}
<h1>Télépaiements</h1>
-{if $smarty.request.op eq "submit" and !$pl_errors}
-
<table class="bicol">
<tr>
<th colspan="2">Paiement via {$meth->text}</th>
</tr>
+{if t($public)}
+ <tr>
+ <td><b>Nom</b></td>
+ <td>{$full_name}</td>
+ </tr>
+{/if}
<tr>
<td><b>Transaction</b></td>
<td>{$pay->text}</td>
</tr>
<tr>
<td><b>Montant</b></td>
- <td>{$montant} €</td>
+ <td>{$amount} €</td>
</tr>
{if $comment}
<tr>
</table>
<p>
En cliquant sur "Valider", tu seras redirigé{if $sex}e{/if} vers le site de {$pay->api->nomsite}, où il te
-sera demandé de saisir ton numéro de carte bancaire. Lorsque le paiement aura été effectué, tu
+sera demandé de saisir ton numéro de carte bancaire. Lorsque le paiement aura été effectué, tu
recevras une confirmation par email.
</p>
{if $pay->api->text}
{else}
-<script type='text/javascript'>
-{literal}
-function payment_submit(form)
-{
- form.op.value = 'select';
- form.montant.value = 0;
- form.action = 'payment/' + form.ref.value;
- form.submit();
-}
-{/literal}
-</script>
+{if t($donation)}
+{include wiki=Docs.Dons}
+{/if}
<form method="post" action="{$platal->pl_self()}">
<table class="bicol">
<tr>
<td>Transaction</td>
<td>
- {if t($asso)}
<strong>{$pay->text}</strong><input type="hidden" name="ref" value="{$pay->id}" />
- {else}
- <select name="ref" onchange="payment_submit(this.form)">
- {select_db_table table="payments" valeur=$pay->id
- where="WHERE FIND_IN_SET('old', t.flags) = 0"
- join="LEFT JOIN groups AS g ON (t.asso_id = g.id)" group="g.nom"}
- </select>
- {/if}
{if $pay->url}
<br />
<a href="{$pay->url}">plus d'informations</a>
</tr>
<tr>
<td>Montant</td>
- <td><input type="text" name="montant" size="13" class='right' value="{$montant}" /> €</td>
+ <td><input type="text" name="amount" size="13" class="right" value="{$pay->amount_def}" /> €</td>
</tr>
+ {if t($public)}
+ <tr>
+ <td>Identifiant <small>(prenom.nom.promo)</small></td>
+ <td><input type="text" name="login" size="30" /></td>
+ </tr>
+ {/if}
<tr>
<td>Commentaire</td>
<td><textarea name="comment" rows="5" cols="30"></textarea></td>
</tr>
{if t($donation)}
<tr>
- <td>Afficher ton nom dans la liste des donateurs sur {#globals.core.sitename#}</td>
+ <td>Afficher ton nom dans la liste des donateurs</td>
<td>
<label>Oui<input type="radio" name="display" value="1" checked="checked" /></label>
-
<tr>
<td> </td>
<td>
- {if !t($donation)}<input type="hidden" name="display" value="0" />{/if}
<input type="hidden" name="op" value="submit" />
<input type="submit" value="Continuer" />
</td>
{/if}
{if t($donation)}
-{if !t($donations)}
-<p class="descr">Aucun don n'a encore été recueilli.</p>
-{else}
-<p class="descr">Les dons suivants ont déjà été recueillis (pour un total de {$sum} €) :</p>
+<p class="descr">Les 10 plus gros dons sont les suivants :</p>
<table class="bicol">
<tr>
<th>Nom</th>
<th>Montant</th>
+ <th>Date</th>
</tr>
- {foreach from=$donations item=d}
+ {foreach from=$biggest_donations item=d}
<tr class="{cycle values="pair,impair"}">
<td>{$d.name}</td>
<td class="center">{$d.amount|replace:'.':','} €</td>
+ <td>{$d.ts_confirmed|date_format}</td>
</tr>
{/foreach}
</table>
-{/if}
-{/if}
+<p class="descr">Les dons par période :</p>
+<table class="tinybicol">
+ <tr>
+ <th>Période</th>
+ <th>Montant</th>
+ </tr>
+ {foreach from=$donations item=d}
+ <tr class="{cycle values="pair,impair"}">
+ <td>{if $d.month neq 0}{$d.ts_confirmed|date_format:"%B %Y"}{else}{$d.ts_confirmed|date_format:"%Y"}{/if}</td>
+ <td style="text-align: right">{$d.amount|replace:'.':','} €</td>
+ </tr>
+ {/foreach}
+</table>
{/if}
+{/if}
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
http://www.carva.org/{$smarty.session.user->hruid} vers la page de ton choix.<br />
<a href="prefs/webredirect">Gérer ta redirection Web</a>
</dd>
+ <dt>Paramètres d'envois d'emails depuis le site</dt>
+ <dd>
+ Tu peux faire retenir au site les paramètres d'envoi par défaut des emails depuis <a href="emails/send">le site</a>.<br />
+ <a href="prefs/email">Gérer tes envois d'emails depuis le site</a>
+ </dd>
</dl>
</fieldset>
{/if}
{assign var=terms value=$profile->getMentoringTerms()}
{assign var=countries value=$profile->getMentoringCountries()}
+{assign var=skills value=$profile->getSkills()}
+{assign var=languages value=$profile->getLanguages()}
<div id="fiche">
<div id="fiche_referent">
<div id="fiche_identite">
</div>
<div class="spacer"></div>
+ {if $skills|count || $languages|count}
+ <div class="part">
+ <h2>Compétences :</h2>
+ {if $skills|count}
+ <div style="float: left">
+ <em>Professionnelles :</em><br />
+ <ul>
+ {foreach from=$skills item="skill"}
+ <li>{$skill.text_fr} ({$skill.level})</li>
+ {/foreach}
+ </ul>
+ </div>
+ {/if}
+ {if $languages|count}
+ <div {if $skills|count}style="float: right"{/if}>
+ <em>Linguistiques :</em><br />
+ <ul>
+ {foreach from=$languages item="language"}
+ <li>{$language.language} ({$language.level})</li>
+ {/foreach}
+ </ul>
+ </div>
+ {/if}
+ <div class="spacer"> </div>
+ </div>
+ {/if}
+
{if $profile->mentor_expertise != '' || $terms|count || $countries|count }
- <div id="part">
+ <div class="part">
<h2>Informations de référent :</h2>
{if $profile->mentor_expertise}
<div class="rubrique_referent">
<li>ou bien, plus âgés, qui souhaitent réorienter leur carrière.</li>
</ul>
+<table class="bicol" id="competences_table" style="margin-bottom: 1em">
+ <tr>
+ <th>
+ <div class="flags" style="float: left">
+ <input type="checkbox" name="accesX" checked="checked" disabled="disabled" />
+ {icon name="flag_red" title="privé"}
+ </div>
+ Compétences professionnelles
+ </th>
+ </tr>
+ <tr>
+ <td>
+ <span class="titre">Domaine :</span>
+ <select name="competences_sel" onchange="updateElement('competences')">
+ <option value=""> </option>
+ {assign var=ingroup value=false}
+ {iterate from=$comp_list item=comp}
+ {if $comp.title}
+ {if $ingroup}</optgroup>{/if}
+ <optgroup label="{$comp.text_fr}">
+ {assign var=ingroup value=true}
+ {/if}
+ <option value="{$comp.id}">{$comp.text_fr}</option>
+ {/iterate}
+ {if $ingroup}</optgroup>{/if}
+ </select>
+ <span id="competences_add" style="display: none">
+ <a href="javascript:addSkill('competences')">{icon name=add title="Ajouter cette compétence"}</a>
+ </span>
+ </td>
+ </tr>
+ <tr class="pair">
+ <td id="competences">
+ {foreach from=$competences item=competence key=id}
+ {include file="profile/skill.skill.tpl" cat='competences' skill=$competence id=$id levels=$comp_level}
+ {/foreach}
+ </td>
+ </tr>
+</table>
+
+<table class="bicol" id="langues_table" style="margin-bottom: 1em">
+ <tr>
+ <th>
+ <div class="flags" style="float: left">
+ <input type="checkbox" name="accesX" checked="checked" disabled="disabled" />
+ {icon name="flag_red" title="privé"}
+ </div>
+ Compétences linguistiques
+ </th>
+ </tr>
+ <tr>
+ <td>
+ <span class="titre">Domaine :</span>
+ <select name="langues_sel" onchange="updateElement('langues')">
+ <option value=""> </option>
+ {iterate from=$lang_list item=lang}
+ <option value="{$lang.iso_639_2b}">{$lang.language}</option>
+ {/iterate}
+ </select>
+ <span id="langues_add" style="display: none">
+ <a href="javascript:addSkill('langues')">{icon name=add title="Ajouter cette langue"}</a>
+ </span>
+ </td>
+ </tr>
+ <tr class="pair">
+ <td id="langues">
+ {foreach from=$langues item=langue key=id}
+ {include file="profile/skill.skill.tpl" cat='langues' skill=$langue id=$id levels=$lang_level}
+ {/foreach}
+ </td>
+ </tr>
+ </table>
+
<table class="bicol" id="countries_table" style="margin-bottom: 1em" summary="Profil : Mentoring">
<tr>
<th>
+++ /dev/null
-{**************************************************************************}
-{* *}
-{* Copyright (C) 2003-2011 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 *}
-{* *}
-{**************************************************************************}
-
-<table class="bicol" id="competences_table" style="margin-bottom: 1em">
- <tr>
- <th>
- <div class="flags" style="float: left">
- <input type="checkbox" name="accesX" checked="checked" disabled="disabled" />
- {icon name="flag_red" title="privé"}
- </div>
- Compétences professionnelles
- </th>
- </tr>
- <tr>
- <td>
- <span class="titre">Domaine :</span>
- <select name="competences_sel" onchange="updateElement('competences')">
- <option value=""> </option>
- {assign var=ingroup value=false}
- {iterate from=$comp_list item=comp}
- {if $comp.title}
- {if $ingroup}</optgroup>{/if}
- <optgroup label="{$comp.text_fr}">
- {assign var=ingroup value=true}
- {/if}
- <option value="{$comp.id}">{$comp.text_fr}</option>
- {/iterate}
- {if $ingroup}</optgroup>{/if}
- </select>
- <span id="competences_add" style="display: none">
- <a href="javascript:addSkill('competences')">{icon name=add title="Ajouter cette compétence"}</a>
- </span>
- </td>
- </tr>
- <tr class="pair">
- <td id="competences">
- {foreach from=$competences item=competence key=id}
- {include file="profile/skill.skill.tpl" cat='competences' skill=$competence id=$id levels=$comp_level}
- {/foreach}
- </td>
- </tr>
-</table>
-
-<table class="bicol" id="langues_table">
- <tr>
- <th>
- <div class="flags" style="float: left">
- <input type="checkbox" name="accesX" checked="checked" disabled="disabled" />
- {icon name="flag_red" title="privé"}
- </div>
- Compétences linguistiques
- </th>
- </tr>
- <tr>
- <td>
- <span class="titre">Domaine :</span>
- <select name="langues_sel" onchange="updateElement('langues')">
- <option value=""> </option>
- {iterate from=$lang_list item=lang}
- <option value="{$lang.iso_639_2b}">{$lang.language}</option>
- {/iterate}
- </select>
- <span id="langues_add" style="display: none">
- <a href="javascript:addSkill('langues')">{icon name=add title="Ajouter cette langue"}</a>
- </span>
- </td>
- </tr>
- <tr class="pair">
- <td id="langues">
- {foreach from=$langues item=langue key=id}
- {include file="profile/skill.skill.tpl" cat='langues' skill=$langue id=$id levels=$lang_level}
- {/foreach}
- </td>
- </tr>
- </table>
-
-{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
<a href="Reference/Convention-AX">Lien avec l'AX</a>
-
<a href="Equipe/APropos">À propos de ce site et ses équipes</a>
+ {if hasPerm('payment')}
+ -
+ <a href="payment">Faire un don</a>
+ {/if}
<br />
<a href="Docs/Ethique">Services et éthique</a>
| <a href="Reference/Charte">Charte</a>
{else}
-{if $smarty.session.auth == AUTH_MDP}
+{if $smarty.session.auth == AUTH_PASSWD}
<div class="menu_item"><a href="exit">Déconnexion</a></div>
{elseif $smarty.cookies.ORGaccess}
<div class="menu_item"><a href="exit/forget">Déconnexion totale</a></div>
{if hasPerm('user')}
<div class="menu_item"><a href="lists">Listes de diffusion</a></div>
{/if}
-{if hasPerm('payment')}
-<div class="menu_item"><a href="payment">Télépaiements</a></div>
-{/if}
{if hasPerm('mail')}
<div class="menu_item"><a href="emails/antispam/submit">Soumettre un spam</a></div>
{/if}
{elseif $mail_part eq 'text'}
Bonjour,
-{$sender_name} nous a demandé de vous créer un compte pour que vous puissiez disposer pleinement de toutes les fonctionnalités liées au groupe {$group}.
+{$sender_name} nous a demandé de vous {if $again}relancer{else}créer un compte{/if} pour que vous puissiez disposer pleinement de toutes les fonctionnalités liées au groupe {$group}.
Après activation, vos paramètres de connexion seront :
qui aura lieu {$evt.date}.
</p>
-{if $participants|@count && $is_admin}
+{if $evt.short_name && $participants|@count && $is_admin}
<p class="center">
[<a href="mailto:?bcc={$evt.short_name}-participants@{#globals.xnet.evts_domain#}">envoyer un email à ceux qui viennent</a>]
<br />
{$profile->fullName("promo")}{/if}</textarea><br />
{assign var='asso_url' value=$globals->baseurl|cat:'/'|cat:$platal->ns}
Page internet de l'événement : <input size="40" name="site" value="{$paiement_site|default:$asso->site|default:$asso_url}" /><br />
- <label><input type="checkbox" name="donation" {if t($donation)}check="checked"{/if} />Afficher la liste des payeurs ne s'y opposant pas sur {#globals.core.sitename#}</label><br />
+ Rendre public le télépaiement :
+ <label><input type="radio" name="payment_public" value="no" {if !t($payment_public)}checked="checked"{/if} />Non</label>
+ -
+ <label>Oui<input type="radio" name="payment_public" value="yes" {if t($payment_public)}checked="checked"{/if} /></label><br />
+ Attention : cela aura pour effet de rendre accessible ce télépaiement à tout le monde, même aux personnes non connectées.<br />
Le nouveau paiement sera activé automatiquement après validation par le trésorier de Polytechnique.org,
ce qui sera fait sous peu.
<script type="text/javascript">//<![CDATA[
</div>
{/if}
+{if t($payments)}
+<p>Télépaiements publics pour le groupe {$asso->nom} :</p>
+<ul>
+{foreach from=$payments item=payment}
+<li><a href="{$platal->ns}payment/{$payment.id}">{icon name=money title="Télépaiement"}{$payment.text}</a></li>
+{/foreach}
+</ul>
+{/if}
+
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
Nom :
</td>
<td>
- <input type="text" size="40" value="{$asso->nom}" name="nom" />
+ <input type="text" size="40" value="{if $error}{$nom}{else}{$asso->nom}{/if}" name="nom" />
</td>
</tr>
<tr>
Diminutif :
</td>
<td>
- <input type="text" size="40" value="{$asso->diminutif}" name="diminutif" />
+ <input type="text" size="40" value="{if $error}{$diminutif}{else}{$asso->diminutif}{/if}" name="diminutif" />
</td>
</tr>
<tr>
Domaine DNS :
</td>
<td>
- <input type="text" size="40" value="{$asso->mail_domain}" name="mail_domain" />
+ <input type="text" size="40" value="{if $error}{$mail_domain}{else}{$asso->mail_domain}{/if}" name="mail_domain" />
</td>
</tr>
<tr>
</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 $cat eq 'GroupesX'}selected="selected"{/if}>Groupes X</option>
+ <option value="binets" {if $cat eq 'Binets'}selected="selected"{/if}>Binets</option>
+ <option value="promotions" {if $cat eq 'Promotions'}selected="selected"{/if}>Promotions</option>
+ <option value="institutions" {if $cat eq 'Institutions'}selected="selected"{/if}>Institutions</option>
</select>
</td>
</tr>
<td>
<select name="dom">
<option value=""> </option>
- {iterate from=$dom item=d}
- <option value="{$d.id}" {if $d.id eq $asso->dom}selected="selected"{/if}>{$d.nom} [{$d.cat}]</option>
+ {iterate from=$domains item=d}
+ <option value="{$d.id}" {if $d.id eq $dom}selected="selected"{/if}>{$d.nom} [{$d.cat}]</option>
{/iterate}
</select>
</td>
</tr>
<tr>
<td class="titre center" colspan="2">
- <label><input type="checkbox" value="1" name="ax" {if $asso->ax}checked="checked"{/if} />
- groupe agréé par l'AX</label> le <input type="text" size="10" maxlength="10" value="{$asso->axDate}" name="axDate" />
+ <label><input type="checkbox" value="1" name="ax" {if $ax}checked="checked"{/if} />
+ groupe agréé par l'AX</label> le <input type="text" size="10" maxlength="10" value="{if $error}{$axDate}{$asso->axDate}{/if}" name="axDate" />
<small>(ex: 01/01/1970)</small>
</td>
</tr>
Site web :
</td>
<td>
- <input type="text" size="40" value="{$asso->site|default:"http://"}" name="site" />
+ <input type="text" size="40" value="{if $error}{$site}{else}{$asso->site|default:"http://"}{/if}" name="site" />
</td>
</tr>
Contact :
</td>
<td>
- <input type="text" size="40" name="resp" value="{$asso->resp}" />
+ <input type="text" size="40" name="resp" value="{if $error}{$resp}{else}{$asso->resp}{/if}" />
</td>
</tr>
Adresse email :
</td>
<td>
- <input type="text" size="40" name="mail" value="{$asso->mail}" />
+ <input type="text" size="40" name="mail" value="{if $error}{$mail}{else}{$asso->mail}{/if}" />
</td>
</tr>
<tr>
<td class="titre">Téléphone</td>
<td>
- <input type="text" maxlength="28" name="phone" value="{$asso->phone}" />
+ <input type="text" maxlength="28" name="phone" value="{if $error}{$phone}{else}{$asso->phone}{/if}" />
</td>
</tr>
<tr>
<td class="titre">Fax</td>
<td>
- <input type="text" maxlength="28" name="fax" value="{$asso->fax}" />
+ <input type="text" maxlength="28" name="fax" value="{if $error}{$fax}{else}{$asso->fax}{/if}" />
</td>
</tr>
<tr>
<td class="titre">Adresse</td>
<td>
- <textarea name="address" cols="30" rows="4">{$asso->address}</textarea>
+ <textarea name="address" cols="30" rows="4">{if $error}{$address}{else}{$asso->address}{/if}</textarea>
</td>
</tr>
Forum :
</td>
<td>
- <input type="text" size="40" name="forum" value="{$asso->forum}" />
+ <input type="text" size="40" name="forum" value="{if $error}{$forum}{else}{$asso->forum}{/if}" />
</td>
</tr>
Inscription possible :
</td>
<td>
- <input type="radio" value="1" id="inscr_yes"
- {if $asso->inscriptible eq 1}checked="checked"{/if}
- name="inscriptible" />
- <label for="inscr_yes">oui</label>
- <input type="radio" value="0" id="inscr_no"
- {if $asso->inscriptible neq 1}checked="checked"{/if}
- name="inscriptible" />
- <label for="inscr_no">non</label>
+ <label><input type="radio" value="1" {if $inscriptible eq 1}checked="checked"{/if} name="inscriptible" />oui</label>
+ <label><input type="radio" value="0" {if $inscriptible neq 1}checked="checked"{/if} name="inscriptible" />non</label>
</td>
</tr>
<em>laisser vide par défaut</em>
</td>
<td>
- <input type="text" size="40" name="sub_url" value="{$asso->sub_url}" />
+ <input type="text" size="40" name="sub_url" value="{if $error}{$sub_url}{else}{$asso->sub_url}{/if}" />
</td>
</tr>
<em>laisser vide par défaut</em>
</td>
<td>
- <input type="text" size="40" name="unsub_url" value="{$asso->unsub_url}" />
+ <input type="text" size="40" name="unsub_url" value="{if $error}{$unsub_url}{else}{$asso->unsub_url}{/if}" />
</td>
</tr>
<em>envoyé à l'inscription</em>
</td>
<td>
- <textarea cols='40' rows='8' name='welcome_msg'>{$asso->welcome_msg}</textarea>
+ <textarea cols='40' rows='8' name='welcome_msg'>{if $error}{$welcome_msg}{else}{$asso->welcome_msg}{/if}</textarea>
</td>
</tr>
<td class="titre center" colspan="2">
Diffusion de la liste des membres :
<select name="pub">
- <option value="public" {if $asso->pub eq 'public'}selected="selected"{/if}>Publique</option>
- <option value="membre" {if $asso->pub eq 'membre'}selected="selected"{/if}>Aux membres du groupe</option>
- <option value="private" {if $asso->pub eq 'private'}selected="selected"{/if}>Aux animateurs du groupe</option>
+ <option value="public" {if $pub eq 'public'}selected="selected"{/if}>Publique</option>
+ <option value="membre" {if $pub eq 'membre'}selected="selected"{/if}>Aux membres du groupe</option>
+ <option value="private" {if $pub eq 'private'}selected="selected"{/if}>Aux animateurs du groupe</option>
</select>
</td>
</tr>
<tr>
<td class="titre center" colspan="2">
- <label><input type="checkbox" value="1" name="notif_unsub" {if $asso->notif_unsub}checked="checked"{/if} />
+ <label><input type="checkbox" value="1" name="notif_unsub" {if $notif_unsub}checked="checked"{/if} />
prévenir les animateurs lors de la désinscription d'un membre</label>
</td>
</tr>
<a href="wiki_help" class="popup3">
{icon name=information title="Syntaxe wiki"} Voir la syntaxe wiki autorisée pour la description.
</a>
- <textarea name="descr" cols="70" rows="15" id="descr">{$asso->descr}</textarea>
+ <textarea name="descr" cols="70" rows="15" id="descr">{if $error}{$descr}{else}{$asso->descr}{/if}</textarea>
<input type="submit" name="preview" value="Aperçu de la description"
onclick="previewWiki('descr', 'preview_descr', true, 'preview_descr'); return false;" /><br />
<input type="submit" name="submit" value="Enregistrer" />
<td colspan="2">
<label>
<input type="checkbox" name="suggest" />
- coche cette case si tu souhaites qu'un compte « Extérieur » soit créé
+ coche cette case si tu souhaites qu'un compte « Extérieur » soit créé
pour cette personne et que nous lui envoyions un email afin qu'il ait
accès aux nombreuses fonctionnalités de Polytechnique.net (inscription
aux évènements, télépaiement, modération des listes de diffusion…)
</td>
</tr>
{/if}
+ {if $user->type eq 'xnet' && $pending_xnet_account}
+ <tr>
+ <td colspan="2">
+ <label>
+ <input type="checkbox" name="again" />
+ Cette personne a un compte « Extérieur » en attente d'activation de sa part. Pour la relancer, il suffit
+ de cocher la case ci-contre.
+ </label>
+ </td>
+ </tr>
+ {/if}
</table>
<h2>Abonnement aux listes</h2>
--- /dev/null
+ALTER TABLE payments MODIFY COLUMN flags SET('unique', 'old') NOT NULL DEFAULT '';
+ALTER TABLE payments MODIFY COLUMN flags SET('unique', 'old', 'public') NOT NULL DEFAULT '';
+
+-- vim:set syntax=mysql:
--- /dev/null
+platal.conf:
+[Money]
+mpay_def_id = 386 # donation id
+
+https://www.polytechnique.org/Docs/Dons must be adapted after the release (cf https://dev.m4x.org/~x2004jacob/Docs/Dons).