$page->assign_by_ref('mails', $sql);
}
- function handler_postfix_regexpsbounces(&$page, $new = null) {
- $page->changeTpl('admin/emails_bounces_re.tpl');
- $page->setTitle('Administration - Postfix : Regexps Bounces');
- $page->assign('new', $new);
-
- if (Post::has('submit')) {
- foreach (Env::v('lvl') as $id=>$val) {
- XDB::query(
- "REPLACE INTO emails_bounces_re (id,pos,lvl,re,text) VALUES ({?}, {?}, {?}, {?}, {?})",
- $id, $_POST['pos'][$id], $_POST['lvl'][$id], $_POST['re'][$id], $_POST['text'][$id]
- );
- }
- }
-
- $page->assign('bre', XDB::iterator("SELECT * FROM emails_bounces_re ORDER BY pos"));
- }
-
// {{{ logger view
/** Retrieves the available days for a given year and month.
} else {
$loguser = $action == 'user' ? $arg : Env::v('loguser');
- $user = User::get($loguser);
- $loguid = $user->id();
+
+ if ($loguser) {
+ $user = User::get($loguser);
+ $loguid = $user->id();
+ } else {
+ $loguid = null;
+ }
if ($loguid) {
$year = Env::i('year');
}
$page->assign_by_ref('sessions', $sessions);
} else {
- $page->assign('msg_nofilters', "Sélectionner une annuée et/ou un utilisateur");
+ $page->assign('msg_nofilters', "Sélectionner une année et/ou un utilisateur");
}
}
$page->addJsLink('jquery.ui.core.js');
+ $page->addJsLink('jquery.ui.widget.js');
$page->addJsLink('jquery.ui.tabs.js');
$page->addJsLink('password.js');
return false;
}
- array_map('trim', $infos);
+ $infos = array_map('trim', $infos);
$hrid = self::getHrid($infos[1], $infos[0], $promo);
$res1 = XDB::query('SELECT COUNT(*)
FROM accounts
private static function formatBirthDate($birthDate)
{
- return date("Y-m-d", strtotime($birthDate));
+ // strtotime believes dd/mm/yyyy to be an US date (i.e mm/dd/yyyy), and
+ // dd-mm-yyyy to be a normal date (i.e dd-mm-yyyy)...
+ return date("Y-m-d", strtotime(str_replace('/', '-', $birthDate)));
}
function handler_add_accounts(&$page, $action = null, $promo = null)
XDB::execute('INSERT INTO account_profiles (uid, pid, perms)
VALUES ({?}, {?}, {?})',
$uid, $pid, 'owner');
- Profile::rebuildSearchTokens($pid);
+ Profile::rebuildSearchTokens($pid, false);
}
}
}
XDB::execute("UPDATE aliases
SET type = 'homonyme', expire=NOW()
WHERE alias = {?}", $loginbis);
- XDB::execute("REPLACE INTO homonyms (homonyme_id, uid)
- VALUES ({?}, {?})", $target, $target);
+ XDB::execute('INSERT IGNORE INTO homonyms (homonyme_id, uid)
+ VALUES ({?}, {?})', $target, $target);
send_robot_homonyme($user, $loginbis);
$op = 'list';
$page->trigSuccess('Email envoyé à ' . $user->forlifeEmail() . ', alias supprimé.');
$page->changeTpl('admin/validation.tpl');
$page->setTitle('Administration - Valider une demande');
$page->addCssLink('nl.css');
- $page->addJsLink('ajax.js');
if ($action == 'edit' && !is_null($id)) {
$page->assign('preview_id', $id);
$hide[] = $cat;
}
$hide_requests = join(',', $hide);
- XDB::query('REPLACE INTO requests_hidden (uid, hidden_requests)
- VALUES ({?}, {?})',
+ XDB::query('INSERT INTO requests_hidden (uid, hidden_requests)
+ VALUES ({?}, {?})
+ ON DUPLICATE KEY UPDATE hidden_requests = VALUES(hidden_requests)',
S::v('uid'), $hide_requests);
} elseif ($hide_requests) {
foreach (explode(',', $hide_requests) as $hide_type)
NAF_code = {?}, AX_code = {?}, holdingid = {?}
WHERE id = {?}',
Env::t('name'), Env::t('acronym'), Env::t('url'), Env::t('email'),
- Env::t('NAF_code'), Env::i('AX_code'), Env::i('holdingId'), $id);
+ (Env::t('NAF_code') == 0 ? null : Env::t('NAF_code')),
+ (Env::i('AX_code') == 0 ? null : Env::t('AX_code')),
+ (Env::i('holdingId') == 0 ? null : Env::t('holdingId')), $id);
$phone = new Phone(array('display' => Env::v('tel'), 'link_id' => $id, 'id' => 0, 'type' => 'fixed',
'link_type' => Phone::LINK_COMPANY, 'pub' => 'public'));