+++ /dev/null
-../banana.feedgen.php
\ No newline at end of file
--- /dev/null
+#!/usr/bin/php5
+<?php
+/********************************************************************************
+ * spoolgen.php : spool generation
+ * --------------
+ *
+ * This file is part of the banana distribution
+ * Copyright: See COPYING files that comes with this distribution
+ ********************************************************************************/
+
+require_once 'connect.db.inc.php';
+require_once dirname(__FILE__).'/../include/banana/ml.inc.php';
+
+Banana::$mbox_helper = $globals->banana->mbox_helper;
+Banana::$spool_root = $globals->banana->spool_root;
+Banana::$nntp_host = "news://{$globals->banana->web_user}:{$globals->banana->web_pass}@{$globals->banana->server}:{$globals->banana->port}/";
+Banana::refreshAllFeeds(array('NNTP', 'MLArchive'));
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
***************************************************************************/
/*
* verifie qu'il n'y a pas d'incoherences dans les tables de jointures
- *
-*/
+ *
+*/
require('./connect.db.inc.php');
require("Console/Getopt.php");
-function check($sql, $commentaire='')
+function check($sql, $commentaire='')
{
$it = XDB::iterRow($sql);
if ($err = XDB::error()) echo $err;
echo "|";
foreach ($arr as $val) echo "\t$val\t|";
echo "\n";
- }
+ }
echo "\n";
}
}
/* donne la liste des emails douteux que les administrateurs n'ont pas encore traité */
check("SELECT a1.alias, a2.alias, e1.email, e2.flags
FROM emails AS e1
- INNER JOIN emails AS e2 ON(e1.email = e2.email AND e1.uid!=e2.uid AND
+ INNER JOIN emails AS e2 ON(e1.email = e2.email AND e1.uid!=e2.uid AND
(e1.uid<e2.uid OR NOT FIND_IN_SET('active', e2.flags))
)
INNER JOIN emails_watch AS w ON(w.email = e1.email AND w.state = 'pending')
/* donne la liste des emails dangereux ou douteux*/
info("SELECT a1.alias, a2.alias, e1.email, e2.flags, w.state
FROM emails AS e1
- INNER JOIN emails AS e2 ON(e1.email = e2.email AND e1.uid!=e2.uid AND
+ INNER JOIN emails AS e2 ON(e1.email = e2.email AND e1.uid!=e2.uid AND
(e1.uid<e2.uid OR NOT FIND_IN_SET('active', e2.flags))
)
INNER JOIN emails_watch AS w ON(w.email = e1.email AND w.state != 'safe')
+++ /dev/null
-../connect.db.inc.php
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2007 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 *
+ ***************************************************************************/
+
+ini_set('include_path',dirname(__FILE__).'/../include:' . dirname(__FILE__).'/../classes:/usr/share/php');
+
+require_once('xorg.inc.php');
+require_once('xorg.misc.inc.php');
+
+require_once 'xdb.php';
+
+$globals->baseurl = "https://www.polytechnique.org";
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
***************************************************************************/
/* vim: set sw=4 ts=4 sts=4 tw=100:
* vérifie qu'il n'y a pas de validations en cours, et maile si c'est le cas
-*/
+*/
$M_PERIOD = "INTERVAL 3 HOUR"; // période d'envoi des mails de 3h
$R_PERIOD = "INTERVAL 6 HOUR"; // période de réponse moyenne de 6h
$message .= "- $type: $nb\n";
}
-$message = wordwrap($message,78);
+$message = wordwrap($message,78);
$mymail->setTxtBody($message);
$mymail->send();
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
require('./connect.db.inc.php');
-/*
+/*
* Check duplicated addresses
*/
$sql = "SELECT a1.alias, a2.alias, e1.email
FROM emails AS e1
- INNER JOIN emails AS e2 ON (e1.email = e2.email AND e1.uid != e2.uid
+ INNER JOIN emails AS e2 ON (e1.email = e2.email AND e1.uid != e2.uid
AND (e1.uid < e2.uid OR NOT FIND_IN_SET('active', e2.flags)))
LEFT JOIN emails_watch AS w ON (e1.email = w.email)
INNER JOIN aliases AS a1 ON (a1.id = e1.uid AND a1.type = 'a_vie')
/* vim: set sw=4 ts=4 sts=4 tw=100:
* crée des demandes de validation pour les kill d'alias
* une demande 10 jours avant pour un warning, puis une autre pour le robot
-*/
+*/
$W_PERIOD = "INTERVAL 7 DAY"; // temps d'envoi du warning avant la deadline
</body>
</html>
EOF;
-
+
$mailer = new PlMailer();
$mailer->setFrom('Carnet Polytechnicien <support_carnet@' . $globals->mail->domain . '>');
$mailer->addTo("\"$u['prenom']} {$u['nom']}\" <{$u['bestalias']}@" . $globals->mail->domain . '>');
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-require_once(dirname(__FILE__) . '/../classes/csvimporter.php');
+require_once(dirname(__FILE__) . '/../classes/csvimporter.php');
// {{{ function showHelp()
// }}}
global $debug, $action, $keys;
-$debug = false;
-$action = CSV_INSERT;
-$keys = 'id';
+$debug = false;
+$action = CSV_INSERT;
+$keys = 'id';
processArgs();
require_once(dirname(__FILE__) . '/../classes/xdb.php');
if($tag =~ / (checked|disabled|multiple|readonly)( |$)/);
print STDERR "${red}XHTML error: ${yel}attribut $1 ${blu}($file)${gra}\n"
if($tag =~ / (align|width|border|color|valign)=/);
-
+
# récupération des classes utilisées ...
if($tag =~ /^(\w+).* class=('{[^}]*}'|"{[^}]*}"|'[^{}']*'|"[^{}"]*")/) {
my $t = lc($1);
foreach my $cl (@cycle) {
&class_add($file,$t,$cl) if($cl);
}
- } else {
+ } else {
&class_add($file,$t,$c);
}
}
#
################################################################################
# CONSTANTS
-#
+#
my $spool = "/var/spool/platal/archives/";
my $tmpbox = "mytmpbox.mbox";
# dummy init
$odir = 1;
}
-
+
$m = $conv{$1};
$y = $2;
open FILE,"> $tmpbox";
}
}
-
+
print FILE $line;
}
else:
h = s
h = str('').join(re.split('[\x00-\x08\x0B-\x1f]+', h))
- return Utils.uquote(h.replace('&', '&').replace('>', '>').replace('<', '<'))
+ return Utils.uquote(h.replace('&', '&').replace('>', '>').replace('<', '<'))
def to_forlife(email):
try:
}
/** Creates a new session entry in database and return its ID.
- *
+ *
* @param $uid the id of the logged user
* @param $suid the id of the administrator who has just su'd to the user
* @return session the session id
VarStream::init();
global $csv_source;
$this->index = null;
-
+
$csv_source = $csv;
$res = fopen('var://csv_source', 'r');
}
if ($current == 'values' && Env::has('csv_valid')) {
$next = 'valid';
- }
+ }
if (empty($csv)) {
$next = 'source';
}
if (Env::has('csv_action')) {
$_SESSION['csv_action'] = Env::v('csv_action');
- }
+ }
if ($next == 'valid') {
if ($current != 'valid') {
$cpyfields = array('csv_value', 'csv_user_value', 'csv_cond_field',
$page->assign('csv_field_desc', $this->field_desc);
$page->assign('csv_page', $next);
$page->assign('csv_path', $url);
- $page->assign('csv_fields', $fields);
+ $page->assign('csv_fields', $fields);
}
}
return Env::_get($key, $default);
}
- public static function s($key, $default = '')
- {
- return (string)Env::_get($key, $default);
- }
+ public static function s($key, $default = '')
+ {
+ return (string)Env::_get($key, $default);
+ }
public static function b($key, $default = false)
{
return (bool)Post::_get($key, $default);
}
- public static function s($key, $default = '')
- {
- return (string)Post::_get($key, $default);
- }
+ public static function s($key, $default = '')
+ {
+ return (string)Post::_get($key, $default);
+ }
public static function i($key, $default = 0)
{
return Cookie::_get($key, $default);
}
- public static function s($key, $default = '')
+ public static function s($key, $default = '')
{
- return (string)Cookie::_get($key, $default);
+ return (string)Cookie::_get($key, $default);
}
public static function b($key, $default = false)
* @param $flag XXX
* @return VOID
*/
- public function addFlag($flag)
+ public function addFlag($flag)
{
if (!$flag) return;
if (!$this->hasflag($flag)) {
* @param $flag XXX
* @return 1 || 0
*/
- public function hasFlag($flag)
+ public function hasFlag($flag)
{
$tok = strtok($this->value,$this->sep);
while ($tok) {
{
$perms = explode(',', $flag);
foreach ($perms as $perm)
- {
- $ok = true;
+ {
+ $ok = true;
$rights = explode(':', $perm);
foreach ($rights as $right) {
if (($right{0} == '!' && $this->hasFlag(substr($right, 1))) || !$this->hasFlag($right)) {
}
if ($ok) {
return true;
- }
+ }
}
- return false;
+ return false;
}
/** remove flag
* @param $flag XXX
* @return VOID
*/
- public function rmFlag($flag)
+ public function rmFlag($flag)
{
if (!$flag) return;
$newvalue = "";
{
return $this->value;
}
-}
+}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>
}
return $id;
}
-
+
public static function init()
{
if (isset(MiniWiki::$patternsWiki[0])) {
return;
}
MiniWiki::Markup("/(\r\n|\r([^\n]))/", "\n$2", "\n$2");
-
+
// retours à la ligne avec \\
MiniWiki::Markup("/\\\\(?".">(\\\\*))\n/e", "str_repeat('<br />\n',mb_strlen('$1'))", "str_repeat('\n',mb_strlen('$1'))", "ligne1\\\\\nligne2");
-
- // * unordered list
+
+ // * unordered list
MiniWiki::Markup("/(^|\n)\*(([^\n]*(\n|$))(\*[^\n]*(\n|$))*)/se",
"'</p><ul><li>'.str_replace(\"\\n*\",'</li><li>','$2').'</li></ul><p>'",
"'$1 -' . str_replace(\"\\n*\", \"\\n -\", '$2')",
- "* element1\n* element2\n* element3");
- // # unordered list
- MiniWiki::Markup("/(^|\n)#(([^\n]*(\n|$))(#[^\n]*(\n|$))*)/se", "'<ol><li>'.str_replace(\"\\n#\",'</li><li>','$2').'</li></ol>'", "'$0'", "# element1\n# element2\n# element3");
-
+ "* element1\n* element2\n* element3");
+ // # unordered list
+ MiniWiki::Markup("/(^|\n)#(([^\n]*(\n|$))(#[^\n]*(\n|$))*)/se", "'<ol><li>'.str_replace(\"\\n#\",'</li><li>','$2').'</li></ol>'", "'$0'", "# element1\n# element2\n# element3");
+
// bold, italic and others
// ''' bold '''
MiniWiki::Markup("/'''(.*?)'''/",'<strong>$1</strong>','*$1*', "'''gras'''");
"%red% texte en rouge %%\\\\\n%#ff0% texte en jaune %%\\\\\n%#0000ff% texte en bleu %%");
// [+ big +] [++ bigger ++] [+++ even bigger +++] ...
MiniWiki::Markup("/\\[(([-+])+)(.*?)\\1\\]/e","'<span style=\'font-size:'.(round(pow(6/5,$2mb_strlen('$1'))*100,0)).'%\'>$3</span>'", "'$3'", "[+ grand +]\n\n[++ plus grand ++]\n\n[+++ encore plus grand +++]");
-
+
// ----- <hr/>
MiniWiki::Markup("/(\n|^)--(--+| \n)/s", '$1<hr/>', '$1-- '."\n", "----\n");
// titles
MiniWiki::$title_index = MiniWiki::Markup('/(\n|^)(!+)([^\n]*)/se',
"'$1<h'.mb_strlen('$2').'>$3</h'.mb_strlen('$2').'>'",
"'$1$3'", "!titre1\n\n!!titre2\n\n!!!titre3");
-
+
// links
MiniWiki::Markup('/((?:https?|ftp):\/\/(?:[\.\,\;\!\:]*[\w@~%$£µ&i#\-+=_\/\?])*)/ui',
'<a href="\\0">\\0</a>', '<\\0>');
MiniWiki::Markup('/\\[\\[\\s*<(?:a href=")?([^>]*)(?:">.*<\/a)?>\\s*\|([^\\]]+)\\]\\]/i',
'<a href="\\1">\\2</a>', '\\2 <\\1>',
"[[http://www.example.com|Mon site web]]\n\nhttp://www.example.com\n\ntest@example.com");
-
+
// paragraphs and empty lines
MiniWiki::Markup("/\n\n/", '</p><p>', "\n\n", "paragraphe1\n\nparagraphe2");
MiniWiki::Markup("/\n/", ' ', "\n");
}
return $html;
}
-
+
private static function justify($text, $n)
{
$arr = explode("\n", wordwrap($text, $n));
$nxl_split = preg_split('! +!u', $nxl);
$nxw_len = count($nxl_split) ? mb_strlen($nxl_split[0]) : 0;
$line = trim($line);
-
+
if (mb_strlen($line)+1+$nxw_len < $n) {
$res .= "$line\n";
continue;
}
-
+
if (preg_match('![.:;]$!u',$line)) {
$res .= "$line\n";
continue;
}
-
+
$tmp = preg_split('! +!u', trim($line));
$words = count($tmp);
if ($words <= 1) {
$res .= "$line\n";
continue;
}
-
+
$len = array_sum(array_map('mb_strlen', $tmp));
$empty = $n - $len;
$sw = floatval($empty) / floatval($words-1);
-
+
$cur = 0;
$l = '';
foreach ($tmp as $word) {
}
return trim($res);
}
-
+
public static function WikiToText($wiki, $just=false, $indent=0, $width=68, $title=false)
{
parent::__construct($url);
if ($globals->debug & DEBUG_BT) {
$this->bt = new PlBacktrace('MMList');
- }
+ }
}
public function __call($method, $args)
if (!isset($place[$part])) {
$place[$part] = array();
}
- $place =& $place[$part];
+ $place =& $place[$part];
}
$place["#final#"] = array();
}
if (Env::has('json') && count($this->_jsonVars)) {
return $this->jsonDisplay();
}
-
+
if (Env::v('display') == 'light') {
$this->_page_type = SIMPLE;
} elseif (Env::v('display') == 'raw') {
{
if (!empty($css)) {
$this->append('xorg_inline_css', $css);
- }
+ }
}
// }}}
/**
* default smarty plugin, used to auto-escape dangerous html.
- *
+ *
* < --> <
* > --> >
* " --> "
$source = preg_replace('/((?<!\?>)\n)[\s]+/m', '\1', $source);
$source = preg_replace("!&&&tags&&&!e", 'array_shift($tagsmatches[0])', $source);
- return $source;
+ return $source;
}
// }}}
$source = str_replace("\n", '', $source);
return '<script type="text/javascript">//<![CDATA[' . "\n" .
'Nix.decode("' . addslashes(str_rot13($source)) . '");' . "\n" .
- '//]]></script>';
+ '//]]></script>';
}
function hide_emails($source, &$smarty)
$source = preg_replace("!<[^>]+[-a-z0-9_+.]+@[-a-z0-9_.]+.+?>!ius", '&&&misc&&&', $source);
//catch !
- $source = preg_replace('!([-a-z0-9_+.]+@[-a-z0-9_.]+)!iue', '_hide_email("\1")', $source);
+ $source = preg_replace('!([-a-z0-9_+.]+@[-a-z0-9_.]+)!iue', '_hide_email("\1")', $source);
$source = preg_replace('!&&&ahref&&&!e', '_hide_email(array_shift($ahref[0]))', $source);
// restore data
$this->template_dir = $globals->spoolroot . "/templates/";
$this->compile_dir = $globals->spoolroot . "/spool/mails_c/";
$this->config_dir = $globals->spoolroot . "/configs/";
-
+
$this->register_outputfilter(Array($this, 'mail_format'));
$this->register_function('from', Array($this, 'setFrom'));
}
/** template function : subject.
- * {subject text=...}
+ * {subject text=...}
*/
public function setSubject($params, &$smarty)
{
$this->page->assign($var, $value);
}
}
-
+
public function assign_by_ref($var, &$value)
{
if (!is_null($this->page)) {
$this->page->register_modifier($var, $callback);
}
}
-
+
public function register_function($var, $callback)
{
if (!is_null($this->page)) {
if(empty($addrs)) {
return false;
}
-
+
$dests = Array();
foreach($addrs as $a) {
$dests[] = "{$a->mailbox}@{$a->host}";
}
-
+
// very important to do it in THIS order very precisely.
$body = $this->get(array('text_charset' => $this->charset,
'text_encoding' => '8bit',
unset($list['page']);
unset($list['order']);
return $list;
- }
+ }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-class PLTableEditor
+class PLTableEditor
{
// the plat/al name of the page
public $pl;
$a['Value'] = $a['List'][0];
} else {
$a['Type'] = 'set';
- }
+ }
}
elseif (substr($a['Type'],0,5) == 'enum(') {
// get the list of options
}
// called before editing $entry
- private function prepare_edit(&$entry)
+ private function prepare_edit(&$entry)
{
foreach ($this->vars as $field => $descr) {
if ($descr['Type'] == 'set') {
}
return $entry;
}
-
+
// set whether the save button show redirect to list view or edit view
public function list_on_edit($var)
{
$this->vars[$name]['desc'] = $desc;
$this->vars[$name]['display'] = $display;
}
-
+
// add a join table, when deleting a row corresponding entries will be deleted in these tables
public function add_join_table($name,$joinid,$joindel,$joinextra="")
{
if ($joindel)
$this->jtables[$name] = array("joinid" => $joinid,"joinextra" => $joinextra?(" AND ".$joinextra):"");
}
-
+
// add a sort key
public function add_sort_field($key, $desc = false, $default = false)
{
} else if (!move_uploaded_file($file['tmp_name'], $this->filename)) {
return false;
}
- $this->checkContentType();
+ $this->checkContentType();
return true;
}
return isset($_SESSION[$key]) ? $_SESSION[$key] : $default;
}
- public static function s($key, $default = '')
+ public static function s($key, $default = '')
{
return (string)Session::v($key, $default);
- }
+ }
public static function i($key, $default = 0)
{
$link = str_replace('%grp', $globals->asso('diminutif'), parent::near_hook());
if ($link != $this->path) {
return $link;
- }
- return null;
+ }
+ return null;
}
protected function find_hook()
color : #a40000;
border-width : 0 0 thin 0;
border-style : dotted;
- border-color : #a40000;
+ border-color : #a40000;
}
div.ax_mail div.signature {
6 Profil
[ onglets des profils ]
*******************************************************************************/
-
+
table.flags {
margin: 1em 0em 0em 0em;
}
#onglet li {
background-color: #ddddff;
border-color: #2f006f;
-}
+}
#onglet li:hover {
background-color: #2f006f;
float: right;
padding-right: 0.2em;
}
-
+
#fiche_identite div.contact {
border-color: #2f006f;
background-color: #eeeeff;
legend {
background-color: #dddddd;
}
-
+
/*******************************************************************************
2 Styles <p>, <div>, <span>, <li>
background-repeat: repeat-y;
background-position: top left;
}
-
+
#body-logo {
border-top: none;
border-bottom: none;
img { vertical-align: middle; }
a img { border: 0px; }
td { vertical-align: top; }
-li { padding-left: 3px; padding-right: 3px;
+li { padding-left: 3px; padding-right: 3px;
text-align: justify; }
hr { text-align: center; }
dt { font-weight: bold; }
}
table.tinybicol tr:first-child th, table.bicol tr:first-child th {
- color: #fff;
+ color: #fff;
background: url('../images/skins/keynote_title.gif') #000 top left repeat-x;
}
#fiche_identite div.civilite {
text-align: center;
font-weight: bold;
- width: 80%;
- float: left;
+ width: 80%;
+ float: left;
color: #fff;
background: inherit;
padding-top: 0.5ex;
#fiche_identite div.email {
- clear: left;
+ clear: left;
float: left;
}
#fiche_identite div.formation {
margin: 0em 1em;
- clear: both;
+ clear: both;
}
div.adresse {
border: 1px #777777 solid;
color: inherit;
}
-
+
/*******************************************************************************
2 Styles <p>, <div>, <span>, <li>
h1 a:hover {
color: #cccccc;
}
-
+
h1 {
color: #eeeeee;
background-color: #444444;
#skin td.skigauche {
background-color: #efddff;
}
-
+
/*******************************************************************************
5 Contacts
[ Styles liés à l'affichage de contacts ]
6 Profil
[ onglets des profils ]
*******************************************************************************/
-
+
table.flags {
margin: 1em 0em 0em 0em;
}
.backtrace:hover div.hide { display: block }
.backtrace h1 { margin: 0px; }
-#suid {
- color: red;
- background: #ffc0cb;
- width: auto;
- font-weight: bold;
- text-align: center;
-}
-#suid a {
- color: red;
- background: inherit;
- text-decoration: none;
- display: block;
-}
-#suid:hover {
- color: red;
- background: #ffffcb;
-}
-#suid a:hover {
- color: #ff7000;
- background: inherit;
-}
+#suid {
+ color: red;
+ background: #ffc0cb;
+ width: auto;
+ font-weight: bold;
+ text-align: center;
+}
+#suid a {
+ color: red;
+ background: inherit;
+ text-decoration: none;
+ display: block;
+}
+#suid:hover {
+ color: red;
+ background: #ffffcb;
+}
+#suid a:hover {
+ color: #ff7000;
+ background: inherit;
+}
table#body {
color: #000;
background: #fff;
border: 3px solid #000;
-
+
width: 900px;
margin: 1em auto;
}
h1 a:hover {
color: #cccccc;
}
-
+
h1 {
color: #eeeeee;
background-color: #444444;
#skin td.skigauche {
background-color: #ccddff;
-}
+}
/*******************************************************************************
5 Contacts
background-color: #ccddff;
}
-#onglet li:hover {
- background-color:
+#onglet li:hover {
+ background-color:
}
#onglet li.actif {
border: 1px #ab8b7d solid;
color: inherit;
}
-
+
/*******************************************************************************
2 Styles <p>, <div>, <span>, <li>
}
h1 a:hover { color: #e2d9c2; }
-
+
h1 {
color: #ffffff;
background-image: url("../images/skins/trapped_titre.gif");
table.tinybicol tr, table.bicol tr { }
table.tinybicol tr.pair, table.bicol tr.pair { background-color: #e2d9c2; }
table.tinybicol th, table.bicol th {
- background-color: #291602;
+ background-color: #291602;
}
table.tinybicol th a:link,
#fiche h2 {
color: #7a614f;
- background-color: #f2e9e2;
+ background-color: #f2e9e2;
border-top: 1px solid #ab8b7d;
- border-bottom: 1px solid #ab8b7d;
+ border-bottom: 1px solid #ab8b7d;
border-right: 1px solid #ab8b7d;
}
/* only for fiche_referent.php*/
#fiche_referent em{color: #5a412f;}
-
+
/*******************************************************************************
A SKIN
[ choix de classes faites par le skinneur
.diffbox {
border: 1px #999999 solid;
- margin-top: 1.33em;
+ margin-top: 1.33em;
}
.diffauthor {
- font-weight: bold;
+ font-weight: bold;
}
.diffchangesum {
- font-weight: bold;
+ font-weight: bold;
}
.difftime {
font-size: 66%;
- background-color: #dddddd;
+ background-color: #dddddd;
}
.difftype {
clear: both;
font-size: 66%;
- font-weight: bold;
+ font-weight: bold;
}
.diffadd {
border-left: 5px #99ff99 solid;
- padding-left: 5px;
+ padding-left: 5px;
}
.diffdel {
border-left: 5px #ffff99 solid;
- padding-left: 5px;
+ padding-left: 5px;
}
.diffrestore {
clear: both;
font-size: 66%;
- margin: 1.5em 0px;
+ margin: 1.5em 0px;
}
a.varlink {
- text-decoration: none;
+ text-decoration: none;
}
a.createlink {
font-size: smaller;
$mbox = $matches[2];
$fqdn = strtolower($matches[3]);
$sup = $matches[4];
-
+
if ($fqdn == 'polytechnique.org') {
http_redirect("https://www.polytechnique.org/lists/$action/$mbox$sup");
}
global $globals;
list($username, $path) = preg_split('/\//', $_SERVER["REQUEST_URI"], 2, PREG_SPLIT_NO_EMPTY);
$res = XDB::query(
- "SELECT redirecturl
- FROM auth_user_quick AS a
- INNER JOIN aliases AS al ON (al.id = a.user_id AND (al.type='a_vie' OR al.type='alias'))
+ "SELECT redirecturl
+ FROM auth_user_quick AS a
+ INNER JOIN aliases AS al ON (al.id = a.user_id AND (al.type='a_vie' OR al.type='alias'))
LEFT JOIN virtuals_redirect AS vr ON (vr.redirect LIKE CONCAT(al.alias, '@%')
INNER JOIN virtuals AS v ON (v.vid = vr.vid)
WHERE al.alias = {?} OR v.alias = CONCAT({?}, '@', {?})
function applis_options($current=0) {
$html = '<option value="-1"></option>';
$res = XDB::iterator("select * from applis_def order by text");
- while ($arr_appli = $res->next()) {
+ while ($arr_appli = $res->next()) {
$html .= '<option value="'.$arr_appli["id"].'"';
if ($arr_appli["id"]==$current) $html .= " selected='selected'";
$html .= '>'.htmlspecialchars($arr_appli["text"])."</option>\n";
$txt .= $type;
if ($text != "Université") {
if ($txt) $txt .= ' ';
- if ($url)
+ if ($url)
$txt .= "<a href=\"$url\" onclick=\"return popup(this)\">$text</a>";
- else
+ else
$txt .= $text;
}
if (!$txt) {
}
// Build user profile
- $req = XDB::query("
- SELECT nom
+ $req = XDB::query("
+ SELECT nom
FROM {$globals->banana->table_prefix}abos
LEFT JOIN {$globals->banana->table_prefix}list ON list.fid=abos.fid
WHERE uid={?}", S::i('uid'));
Banana::$profile['lastnews'] = S::v('banana_last');
Banana::$profile['subscribe'] = $req->fetchColumn();
- // Update the "unread limit"
+ // Update the "unread limit"
if (!is_null($time)) {
XDB::execute("UPDATE auth_user_quick
SET banana_last = FROM_UNIXTIME({?})
Banana::$page->killPage('forums');
Banana::$page->killPage('subscribe');
Banana::$spool_boxlist = false;
- } else {
+ } else {
// Register custom Banana links and tabs
if (!Banana::$profile['autoup']) {
Banana::$page->registerAction('<a href=\'javascript:dynpostkv("'
. $platal->path . '", "updateall", ' . time() . ')\'>'
. 'Marquer tous les messages comme lus'
. '</a>', array('forums', 'thread', 'message'));
- }
+ }
Banana::$page->registerPage('profile', 'Préférences', null);
}
. '<img src="images/icons/user_suit.gif" title="fiche" alt="" /></a>';
} else {
return $address;
- }
+ }
}
if (!empty($text)) {
$text .= ', ';
if (@$params['action'] == 'subscribe') {
return $base . '/subscription';
}
-
+
if (!isset($params['group'])) {
return $base;
}
} else if (Banana::$protocole->name() == 'NNTP' && $xnet) {
if ($feed) {
return 'http://www.polytechnique.org/banana' . hook_platalRSS(@$params['group']);
- }
- $base = $globals->baseurl . '/' . $platal->ns . 'forum';
+ }
+ $base = $globals->baseurl . '/' . $platal->ns . 'forum';
} else if (Banana::$protocole->name() == 'MLArchives') {
if ($feed) {
return $globals->baseurl . '/' . $platal->ns . hook_platalRSS(MLBanana::$listname);
}
if (!is_null($action)) {
if ($action == 'new') {
- $get['action'] = 'new';
+ $get['action'] = 'new';
} elseif (!is_null($artid)) {
- $get['artid'] = $artid;
+ $get['artid'] = $artid;
if ($action == 'reply') {
$get['action'] = 'new';
} elseif ($action == 'cancel') {
} elseif ($action) {
$get['part'] = str_replace('.', '/', $action);
}
- if (Get::v('action') == 'showext') {
- $get['action'] = 'showext';
- }
+ if (Get::v('action') == 'showext') {
+ $get['action'] = 'showext';
+ }
}
}
}
$bt = $banana->backtrace();
if ($bt) {
new PlBacktrace(Banana::$protocole->name(), $banana->backtrace(), 'response', 'time');
- }
+ }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
Banana::$mbox_helper = $globals->banana->mbox_helper;
if (S::has_perms()) {
Banana::$msgshow_mimeparts[] = 'source';
- }
+ }
array_push(Banana::$msgparse_headers, 'x-org-id', 'x-org-mail');
if (!S::v('core_rss_hash')) {
Banana::$feed_active = false;
Banana::$profile['headers']['From'] = "$nom <$mail>";
Banana::$profile['headers']['Organization'] = 'Utilisateur de Polytechnique.org';
Banana::$profile['signature'] = $sig;
-
+
// Page design
Banana::$page->killPage('forums');
- Banana::$page->killPage('subscribe');
+ Banana::$page->killPage('subscribe');
// Run Banana
return parent::run();
public function __construct()
{
- $this->infos = ModerationBanana::$client->get_members(ModerationBanana::$listname);
+ $this->infos = ModerationBanana::$client->get_members(ModerationBanana::$listname);
$this->infos = $this->infos[0];
-
+
$mods = ModerationBanana::$client->get_pending_ops(ModerationBanana::$listname);
$this->helds = $mods[1];
}
-
+
public function isValid()
{
return !is_null(ModerationBanana::$client);
}
-
+
public function lastErrNo()
{
return 0;
}
-
+
public function lastError()
{
return null;
// public function modify_one_email() {{{2
- public function modify_one_email($email, $activate)
+ public function modify_one_email($email, $activate)
{
$allinactive = true;
$thisone = false;
return ERROR_INACTIVE_REDIRECTION;
} else {
return SUCCESS;
- }
+ }
}
// public function modify_one_email_redirect() {{{2
* store on the fly the info of the city concerned
* @param $txt the raw text of an address
*/
-function get_address_infos($txt)
+function get_address_infos($txt)
{
global $globals;
$url = $globals->geoloc->webservice_url."address.php?precise=1&txt=" . urlencode($txt);
/** make the text of an address that can be read by a mailman
* @param $adr an array with all the usual fields
*/
-function get_address_text($adr)
+function get_address_text($adr)
{
$t = "";
if (isset($adr['adr1']) && $adr['adr1']) $t.= $adr['adr1'];
{
$ta = strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"), array("", "\n"), $a));
$tb = strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"), array("", "\n"), $b));
-
+
$la = explode("\n", $ta);
$lb = explode("\n", $tb);
/** synchronise the local geoloc_city base to geoloc.org
* @param $id the id of the city to synchronize
*/
-function synchro_city($id)
+function synchro_city($id)
{
global $globals;
$url = $globals->geoloc->webservice_url."cityFinder.php?method=id&id=".$id."&out=sql";
{
$missing = XDB::query("SELECT c.id
FROM geoloc_city AS c
- LEFT JOIN geoloc_city_in_maps AS m ON(c.id = m.city_id)
+ LEFT JOIN geoloc_city_in_maps AS m ON(c.id = m.city_id)
WHERE m.city_id IS NULL"
. ($cityid ? " AND c.id = '" . $cityid . "'" : "" )
. ($limit ? " LIMIT $limit" : "" ));
if ($lat > 75) {
return latToY(75);
}
- return -100 * log(tan(pi()/4 + deg2rad(1)/2*$lat));
+ return -100 * log(tan(pi()/4 + deg2rad(1)/2*$lat));
}
function size_of_city($nb)
}
}
-function geoloc_getData_subcountries($mapid, $sin, $minentities)
+function geoloc_getData_subcountries($mapid, $sin, $minentities)
{
$countries = array();
$cities = array();
-
+
if ($mapid === false) {
$wheremapid = "WHERE gm.parent IS NULL";
} else {
$wheremapid = "WHERE gm.parent = {?}";
}
$submapres = XDB::iterator(
- "SELECT gm.map_id AS id, gm.name, gm.x, gm.y, gm.xclip, gm.yclip,
+ "SELECT gm.map_id AS id, gm.name, gm.x, gm.y, gm.xclip, gm.yclip,
gm.width, gm.height, gm.scale, 1 AS rat
FROM geoloc_maps AS gm
". $wheremapid, Env::v('mapid',''));
$country['swf'] = $globals->geoloc->webservice_url."maps/mercator/map_".$c['id'].".swf";
$countries[$c['id']] = $country;
}
-
+
if ($mapid === false) {
return array($countries, $cities);
}
array('map.parent'),
array('adresses','geoloc_city_in_maps','geoloc_maps'),
array('am','gcim','map'),
- array(getadr_join('am'),
- 'am.cityid = gcim.city_id',
+ array(getadr_join('am'),
+ 'am.cityid = gcim.city_id',
'map.map_id = gcim.map_id'));
$fields = new SFieldGroup(true, $SFields);
$where = $fields->get_where_statement();
$where,
'map.map_id',
'NULL');
-
+
$maxpop = 0;
$nbentities = $nbcities + $countryres->total();
while ($c = $countryres->next()) {
$c['xPop'] = geoloc_to_x($c['lonPop'], $c['latPop']);
$c['yPop'] = geoloc_to_y($c['lonPop'], $c['latPop']);
@$countries[$c['id']] = array_merge($countries[$c['id']], $c);
-
+
$nbcities += $c['nbCities'];
- }
-
+ }
+
if ($nocity && $nbcities < $minentities){
foreach($countries as $i => $c) {
$countries[$i]['nbPop'] = 0;
if (@$c['nbCities'] > 0) {
geoloc_getData_subcities($c['id'], $sin, $cities, false);
- }
+ }
}
}
-
+
foreach ($countries as $i => $c) {
if ($c['nbPop'] > 0) {
$lambda = pow($c['nbPop'] / $maxpop,0.3);
$countries[$i]['color'] = 0x0000FF + round((1-$lambda) * 0xFF)*0x010100;
}
}
-
- return array($countries, $cities);
-}
+
+ return array($countries, $cities);
+}
// }}}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
$res = XDB::query("SELECT alias FROM aliases WHERE id = {?} AND FIND_IN_SET('bestalias', flags)", $uid);
$bestalias = $res->fetchOneCell();
if ($bestalias && $bestalias != $loginbis) return false;
-
+
// select the shortest alias still alive
$res = XDB::query("SELECT alias FROM aliases WHERE id = {?} AND alias != {?} AND expire IS NULL ORDER BY LENGTH(alias) LIMIT 1", $uid, $loginbis);
$newbest = $res->fetchOneCell();
$this->type = $type;
$this->data = $data;
$this->from = $from;
- $this->sender = $sender;
+ $this->sender = $sender;
}
private function getUser($uid, $email)
WHERE user_id = {?}", $uid);
if ($res->numRows() == 0) {
return null;
- }
+ }
$user = $res->fetchOneAssoc();
$user['id'] = $uid;
$user['forlife'] = make_forlife($user['prenom'], $user['nom'], $user['promo']);
private function getFrom($from, $sender)
{
global $globals;
-
+
if ($from == 'staff') {
return '"L\'équipe de Polytechnique.org" <register@' . $globals->mail->domain . '>';
} else {
if ($valid) {
require_once 'validations.inc.php';
$valid = new MarkReq($this->sender, $this->user['id'], $this->user['mail'],
- $this->from == 'user', $this->type, $this->data);
+ $this->from == 'user', $this->type, $this->data);
$valid->submit();
}
return true;
if (!$email) {
XDB::execute("DELETE FROM register_marketing WHERE uid = {?}", $uid);
} else {
- XDB::execute("DELETE FROM register_marketing WHERE uid = {?} AND email = {?}", $uid, $email);
+ XDB::execute("DELETE FROM register_marketing WHERE uid = {?} AND email = {?}", $uid, $email);
}
}
$res = XDB::query("SELECT COUNT(*) FROM auth_user_md5 WHERE deces=0");
$nbx = $res->fetchOneCell();
}
-
+
$res = XDB::query("SELECT r.date, u.promo, u.nom, u.prenom, r.email, r.bestalias
FROM register_pending AS r
INNER JOIN auth_user_md5 AS u ON u.user_id = r.uid
if (!list($date, $promo, $nom, $prenom, $email, $alias) = $res->fetchOneRow()) {
return false;
}
-
+
require_once('secure_hash.inc.php');
$hash = rand_url_id(12);
$pass = rand_pass();
$pass_encrypted = hash_encrypt($pass);
$fdate = strftime('%d %B %Y', strtotime($date));
-
+
$mymail = new PlMailer('marketing/mail.relance.tpl');
$mymail->assign('nbdix', $nbx);
$mymail->assign('fdate', $fdate);
public function process(array $user);
}
-//
+//
class AnnuaireMarketing implements MarketingEngine
{
protected $titre;
$res = XDB::query("SELECT IF (n.short_name IS NULL, n.id, n.short_name)
FROM {$this->_table} AS n
WHERE n.bits != 'new' AND {$where}
- LIMIT 1");
+ LIMIT 1");
if ($res->numRows() != 1) {
return null;
}
public function head($prenom = null, $nom = null, $sexe = null, $type = 'text')
{
if (is_null($prenom)) {
- return $this->_head;
+ return $this->_head;
} else {
$head = $this->_head;
$head = str_replace('<cher>', $sexe ? 'Chère' : 'Cher', $head);
XDB::execute("UPDATE {$this->_subscriptionTable}
SET last = {?}
WHERE " . implode(' OR ', $sent), $this->_id);
-
+
sleep(60);
}
}
while (list($cid, $title) = $res->next()) {
$this->_cats[$cid] = $title;
}
-
+
$res = XDB::iterRow(
"SELECT a.title,a.body,a.append,a.aid,a.cid,a.pos
FROM newsletter_art AS a
XDB::execute('UPDATE newsletter SET date={?},titre={?},titre_mail={?},head={?},short_name={?} WHERE id={?}',
$this->_date, $this->_title, $this->_title_mail, $this->_head, $this->_shortname,$this->_id);
}
-
+
public function getArt($aid)
{
foreach ($this->_arts as $key=>$artlist) {
$this->_arts['a'.$a->_aid] = $a;
}
}
-
+
public function delArticle($aid)
{
XDB::execute('DELETE FROM newsletter_art WHERE id={?} AND aid={?}', $this->_id, $aid);
protected function setSent()
{
XDB::execute("UPDATE newsletter SET bits='sent' WHERE id={?}", $this->_id);
- }
+ }
static public function subscriptionState($uid = null)
{
FROM newsletter_ins
WHERE user_id={?}", $user);
return $res->fetchOneCell();
- }
-
+ }
+
static public function unsubscribe($uid = null)
{
$user = is_null($uid) ? S::v('uid') : $uid;
class NLArticle
{
// {{{ properties
-
+
var $_aid;
var $_cid;
var $_pos;
// }}}
// {{{ constructor
-
+
function __construct($title='', $body='', $append='', $aid=-1, $cid=0, $pos=0)
{
$this->_body = $body;
// }}}
// {{{ function body()
-
+
public function body()
{ return trim($this->_body); }
-
+
// }}}
// {{{ function append()
-
+
public function append()
{ return trim($this->_append); }
$title = "<h2 class='xorg_nl'><a id='art{$this->_aid}'></a>".pl_entities($this->title()).'</h2>';
$body = MiniWiki::WikiToHTML($this->_body);
$app = MiniWiki::WikiToHTML($this->_append);
-
+
$art = "$title\n";
$art .= "<div class='art'>\n$body\n";
if ($app) {
$art .= "<div class='app'>$app</div>";
}
$art .= "</div>\n";
-
+
return $art;
}
// }}}
// {{{ function getNbNotifs
-function getNbNotifs()
+function getNbNotifs()
{
if (!S::has('uid')) {
return 0;
// }}}
// {{{ class AllNotifs
-class AllNotifs
+class AllNotifs
{
public $_cats = Array();
public $_data = Array();
// }}}
// {{{ class Notifs
-class Notifs
+class Notifs
{
public $_uid;
public $_cats = Array();
// }}}
// {{{ class Watch
-class Watch
+class Watch
{
public $_uid;
public $_promos;
register_shutdown_function('pl_print_errors');
// register_shutdown_function('pl_dump_env');
-/** Check if the string is utf8
+/** Check if the string is utf8
*/
function is_utf8($s)
{
return @iconv('utf-8', 'utf-8', $s) == $s;
}
-/** vérifie si une adresse email est bien formatée * ATTENTION, cette fonction ne doit pas être appelée sur une chaîne ayant subit un addslashes (car elle accepte le "'" qui it alors un "\'"
- * @param $email l'adresse email a verifier
+/** vérifie si une adresse email est bien formatée * ATTENTION, cette fonction ne doit pas être appelée sur une chaîne ayant subit un addslashes (car elle accepte le "'" qui it alors un "\'"
+ * @param $email l'adresse email a verifier
* @return BOOL */
-function isvalid_email($email)
+function isvalid_email($email)
{
- // la rfc2822 authorise les caractères "a-z", "0-9", "!", "#", "$", "%", "&", "'", "*", "+", "-", "/", "=", "?", "^", `", "{", "|", "}", "~" aussi bien dans la partie locale que dans le domaine.
- // Pour la partie locale, on réduit cet ensemble car il n'est pas utilisé.
- // Pour le domaine, le système DNS limite à [a-z0-9.-], on y ajoute le "_" car il est parfois utilisé.
- return preg_match("/^[a-z0-9_.'+-]+@[a-z0-9._-]+\.[a-z]{2,4}$/i", $email);
+ // la rfc2822 authorise les caractères "a-z", "0-9", "!", "#", "$", "%", "&", "'", "*", "+", "-", "/", "=", "?", "^", `", "{", "|", "}", "~" aussi bien dans la partie locale que dans le domaine.
+ // Pour la partie locale, on réduit cet ensemble car il n'est pas utilisé.
+ // Pour le domaine, le système DNS limite à [a-z0-9.-], on y ajoute le "_" car il est parfois utilisé.
+ return preg_match("/^[a-z0-9_.'+-]+@[a-z0-9._-]+\.[a-z]{2,4}$/i", $email);
}
function pl_url($path, $query = null, $fragment = null)
}
// example of use for diff_user_details : get $b from database, $a from other site
-// calculate diff $c and add $c in database (with set_user_details)
+// calculate diff $c and add $c in database (with set_user_details)
function diff_user_details(&$a, &$b, $view = 'private') { // compute $c = $a - $b
// if (!isset($b) || !$b || !is_array($b) || count($b) == 0)
// return $a;
$a['pub'] = $b['pub'];
if (isset($b['tels'])) {
$bvar = $b['tels'];
-
+
$telids_b = array();
- foreach ($bvar as $i => $telb) $telids_b[$telb['telid']] = $i;
+ foreach ($bvar as $i => $telb) $telids_b[$telb['telid']] = $i;
- if (isset($a['tels']))
+ if (isset($a['tels']))
$avar = $a['tels'];
else
$avar = array();
}
}
}
-
+
foreach ($telids_b as $telidb => $i)
$ctels[] = array('telid' => $telidb, 'remove' => 1);
function diff_user_addresses(&$a, &$b) {
$c = $a;
$adrids_b = array();
- foreach ($b as $i => $adrb) $adrids_b[$adrb['adrid']] = $i;
-
+ foreach ($b as $i => $adrb) $adrids_b[$adrb['adrid']] = $i;
+
foreach ($a as $j => $adra) {
if (isset($adra['adrid'])) {
// if b has an address with the same adrid, compute diff
if ($template) {
header('Content-Type: application/rss+xml; charset=utf8');
- }
+ }
return $uid;
}
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-
+
function hash_encrypt($s) {
return sha1($s);
}
$userax = Array();
$userax['matricule_ax'] = $matricule_ax;
-
+
$userax['nom'] = strtoupper($ancien->Nom_patr());
$userax['nom_usage'] = strtoupper($ancien->Nom_usuel());
if ($userax['nom_usage'] == $userax['nom']) $userax['nom_usage'] = '';
$userax['corps'] = $ancien->Corps();
$userax['corps_grade'] = $ancien->Grade();
} */
- $userax['adr_pro'] = array();
-
+ $userax['adr_pro'] = array();
+
for ($i = 0; $i < $ancien->Num_Activite(); $i++) {
$jobax = array();
$jobax['entreprise'] = $ancien->Entreprise($i);
if ($ancien->Mobile($i)) $userax['mobile'] = $ancien->Mobile($i);
$userax['adr'][$i] = $adrax;
}
-
+
/* $userax['formation'] = array();
for($i=$ancien->Num_formation() - 1; $i >= 0; $i--)
$userax['formation'][$i] = $ancien->Formation($i);*/
array_push($tables_to_clear['uid'], 'emails', 'groupex.membres', 'contacts', 'adresses', 'tels',
'photo', 'perte_pass', 'langues_ins', 'forums.abos', 'forums.profils');
array_push($tables_to_clear['user_id'], 'newsletter_ins', 'auth_user_quick', 'binets_ins');
- $tables_to_clear['id'] = array('aliases');
+ $tables_to_clear['id'] = array('aliases');
$tables_to_clear['contact'] = array('contacts');
$tables_to_clear['guid'] = array('groupesx_ins');
XDB::execute("UPDATE auth_user_md5
if (strstr($data, '@')===false) {
$data = $data.'@'.$globals->mail->domain;
}
-
+
list($mbox, $fqdn) = explode('@', $data);
if ($fqdn == $globals->mail->domain || $fqdn == $globals->mail->domain2) {
return false;
} elseif ($fqdn == $globals->mail->alias_dom || $fqdn == $globals->mail->alias_dom2) {
-
+
$res = XDB::query("SELECT redirect
FROM virtual_redirect
INNER JOIN virtual USING(vid)
case 0:
call_user_func($callback, $data);
return false;
-
+
case 1:
return $res->fetchOneCell();
-
+
default:
if (S::has_perms()) {
$aliases = $res->fetchColumn();
}
}
}
-
+
return false;
}
// {{{ function has_user_right()
function has_user_right($pub, $view = 'private') {
if ($pub == $view) return true;
- // all infos available for private
+ // all infos available for private
if ($view == 'private') return true;
- // public infos available for all
+ // public infos available for all
if ($pub == 'public') return true;
// here we have view = ax or public, and pub = ax or private, and pub != view
- return false;
+ return false;
}
// }}}
// {{{ function get_not_registered_user()
$sql = "SELECT user_id, nom, prenom, promo
FROM auth_user_md5
WHERE $where
- ORDER BY promo, nom, prenom";
+ ORDER BY promo, nom, prenom";
if ($iterator) {
return XDB::iterator($sql, $nom, $prenom, $promo);
} else {
}
if (!has_user_right($pro['tel_pub'], $view)) {
// if no tel was defined, then the viewer will be able to write it
- if ($pro['tel'] == '' &&
+ if ($pro['tel'] == '' &&
$pro['fax'] == '' &&
$pro['mobile'] == '') {
$all_pro[$i]['tel_pub'] = $view;
else
$adrid_index[$adr['adrid']] = $i;
}
-
+
$sql = "SELECT t.adrid, t.tel_pub, t.tel_type, t.tel, t.telid
FROM tels AS t
INNER JOIN adresses AS a ON (a.uid = t.uid) AND (a.adrid = t.adrid)
$adrid = $nexttel['adrid'];
unset($nexttel['adrid']);
if (isset($adrid_index[$adrid])) {
- if (!isset($all_adr[$adrid_index[$adrid]]['tels']))
+ if (!isset($all_adr[$adrid_index[$adrid]]['tels']))
$all_adr[$adrid_index[$adrid]]['tels'] = array($nexttel);
else
$all_adr[$adrid_index[$adrid]]['tels'][] = $nexttel;
LEFT JOIN contacts AS c ON (c.uid = {?} and c.contact = u.user_id)
LEFT JOIN geoloc_pays AS gp ON (gp.a2 = u.nationalite)
INNER JOIN sections AS s ON (s.id = u.section)
- LEFT JOIN photo AS p ON (p.uid = u.user_id)
+ LEFT JOIN photo AS p ON (p.uid = u.user_id)
LEFT JOIN mentor AS m ON (m.uid = u.user_id)
LEFT JOIN emails AS e ON (e.uid = u.user_id AND e.flags='active')
WHERE a.alias = {?}
$res = XDB::query($sql, $uid);
$user['binets'] = $res->fetchColumn();
$user['binets_join'] = join(', ', $user['binets']);
-
+
$res = XDB::iterRow("SELECT text, url
FROM groupesx_ins
LEFT JOIN groupesx_def ON groupesx_ins.gid = groupesx_def.id
while (list($gxt, $gxu) = $res->next()) {
$user['gpxs'][] = $gxu ? "<a href=\"$gxu\">$gxt</a>" : $gxt;
$user['gpxs_name'][] = $gxt;
- }
+ }
$user['gpxs_join'] = join(', ', $user['gpxs']);
}
INNER JOIN applis_def ON applis_def.id = applis_ins.aid
WHERE uid={?}
ORDER BY ordre", $uid);
-
+
$user['applis_fmt'] = Array();
$user['formation'] = Array();
while (list($txt, $url, $type) = $res->next()) {
function update_user_address($uid, $adrid, $adr) {
// update address
XDB::execute(
- "UPDATE adresses AS a LEFT JOIN geoloc_pays AS gp ON (gp.pays = {?})
+ "UPDATE adresses AS a LEFT JOIN geoloc_pays AS gp ON (gp.pays = {?})
SET `adr1` = {?}, `adr2` = {?}, `adr3` = {?},
`postcode` = {?}, `city` = {?}, a.`country` = gp.a2, `datemaj` = NOW(), `pub` = {?}
WHERE adrid = {?} AND uid = {?}",
$set = "";
$args_join = array();
$args_set = array();
-
+
$join .= "LEFT JOIN emploi_secteur AS s ON(s.label LIKE {?})
LEFT JOIN emploi_ss_secteur AS ss ON(s.id = ss.secteur AND ss.label LIKE {?})
LEFT JOIN fonctions_def AS f ON(f.fonction_fr LIKE {?} OR f.fonction_en LIKE {?})";
$args_set[] = $pro['poste'];
$args_set[] = $pro['web'];
$args_set[] = $pro['pub'];
-
+
if (isset($pro['adr1'])) {
$join .= "LEFT JOIN geoloc_pays AS gp ON (gp.country LIKE {?} OR gp.pays LIKE {?})
LEFT JOIN geoloc_region AS gr ON (gr.a2 = gp.a2 AND gr.name LIKE {?})";
$args_set[] = $pro['city'];
$args_set[] = $pro['adr_pub'];
}
-
+
if (isset($pro['tel'])) {
$set .= ", e.`tel` = {?}, e.`fax` = {?}, e.`mobile` = {?}, e.tel_pub = {?}";
$args_set[] = $pro['tel'];
$set .= ", e.`email` = {?}, e.`email_pub` = {?}";
$args_set[] = $pro['email'];
$args_set[] = $pro['email_pub'];
- }
+ }
$query = "UPDATE entreprises AS e ".$join." SET ".substr($set,1)." WHERE e.uid = {?} AND e.entrid = {?}";
$args_where = array($uid, $entrid);
$args = array_merge(array($query), $args_join, $args_set, $args_where);
XDB::execute(
"INSERT INTO binets_ins (`user_id`, `binet_id`)
SELECT {?}, id FROM binets_def WHERE text = {?} LIMIT 1",
- $uid, $binet);
+ $uid, $binet);
}
if (isset($details['gpxs']) && is_array($details['gpxs'])) {
XDB::execute("DELETE FROM groupesx_ins WHERE user_id = {?}", $uid);
"INSERT INTO groupesx_ins (`user_id`, `binet_id`)
SELECT {?}, id FROM groupesx_def WHERE text = {?} LIMIT 1",
$uid, $groupex);
- }
+ }
}
// applis
// medals
// {{{ function set_new_usage()
function set_new_usage($uid, $usage, $alias=false)
-{
+{
XDB::execute("UPDATE auth_user_md5 set nom_usage={?} WHERE user_id={?}",$usage ,$uid);
XDB::execute("DELETE FROM aliases WHERE FIND_IN_SET('usage',flags) AND id={?}", $uid);
if ($alias && $usage) {
// {{{ function get_X_mat
function get_X_mat($ourmat)
{
- if (!preg_match('/^[0-9]{8}$/', $ourmat)) {
+ if (!preg_match('/^[0-9]{8}$/', $ourmat)) {
// le matricule de notre base doit comporter 8 chiffres
return 0;
- }
-
+ }
+
$year = intval(substr($ourmat, 0, 4));
$rang = intval(substr($ourmat, 5, 3));
if ($year < 1996) {
- return;
+ return;
} elseif ($year < 2000) {
$year = intval(substr(1900 - $year, 1, 3));
return sprintf('%02u0%03u', $year, $rang);
$year = intval(substr(1900 - $year, 1, 3));
return sprintf('%03u%03u', $year, $rang);
}
-}
-
+}
+
// }}}
{
global $globals;
parent::__construct('auth_user_md5 AS u',
- (!empty($GLOBALS['IS_XNET_SITE']) ?
- 'INNER JOIN groupex.membres AS gxm ON (u.user_id = gxm.uid
+ (!empty($GLOBALS['IS_XNET_SITE']) ?
+ 'INNER JOIN groupex.membres AS gxm ON (u.user_id = gxm.uid
AND gxm.asso_id = ' . $globals->asso('id') . ') ' : '')
- . 'LEFT JOIN auth_user_quick AS q USING (user_id)
+ . 'LEFT JOIN auth_user_quick AS q USING (user_id)
LEFT JOIN aliases AS a ON (a.id = u.user_id AND type = \'a_vie\')
' . $joins,
$where,
LEFT JOIN geoloc_pays AS gp ON (adr.country = gp.a2)
LEFT JOIN geoloc_region AS gr ON (adr.country = gr.a2 AND adr.region = gr.region)
LEFT JOIN emails AS em ON (em.uid = u.user_id AND em.flags = 'active')" .
- (S::logged() ?
+ (S::logged() ?
"LEFT JOIN contacts AS c On (c.contact = u.user_id AND c.uid = " . S::v('uid') . ")"
: "");
}
{
public function __construct(PlSet &$set, $data, array $params)
{
- $this->entriesPerPage = 10;
+ $this->entriesPerPage = 10;
$this->addSortKey('rand', array('RAND(' . S::i('uid') . ')'), 'aléatoirement');
- $this->addSortKey('name', array('nom', 'prenom'), 'nom');
- $this->addSortKey('promo', array('-promo', 'nom', 'prenom'), 'promotion');
- $this->addSortKey('date_mod', array('-date', '-promo', 'nom', 'prenom'), 'dernière modification');
- parent::__construct($set, $data, $params);
+ $this->addSortKey('name', array('nom', 'prenom'), 'nom');
+ $this->addSortKey('promo', array('-promo', 'nom', 'prenom'), 'promotion');
+ $this->addSortKey('date_mod', array('-date', '-promo', 'nom', 'prenom'), 'dernière modification');
+ parent::__construct($set, $data, $params);
}
public function fields()
abstract class Validate
{
// {{{ properties
-
+
public $uid;
public $prenom;
public $nom;
public $unique;
// enable the refuse button
public $refuse = true;
-
+
public $type;
public $comments = Array();
// the validations rules : comments for admins
// }}}
// {{{ constructor
-
+
/** constructeur
* @param $_uid user id
* @param $_unique requête pouvant être multiple ou non
WHERE u.user_id={?}", $_uid);
list($this->prenom, $this->nom, $this->promo, $this->sexe, $this->forlife, $this->bestalias) = $res->fetchOneRow();
}
-
+
// }}}
// {{{ function submit()
if ($this->unique) {
XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?}', $this->uid, $this->type);
}
-
+
$this->stamp = date('YmdHis');
XDB::execute('INSERT INTO requests (user_id, type, data, stamp) VALUES ({?}, {?}, {?}, {?})',
$this->uid, $this->type, $this, $this->stamp);
// }}}
// {{{ function clean()
-
+
/** fonction à utiliser pour nettoyer l'entrée de la requête dans la table requests
* attention, tout est supprimé si c'est un unique
*/
// }}}
// {{{ function handle_formu()
-
+
/** fonction à réaliser en cas de valistion du formulaire
*/
public function handle_formu()
$mailer->addTo($globals->core->admin_emails);
$body = "Validation {$this->type} pour {$this->prenom} {$this->nom}\n\n"
- . S::v('bestalias')." a ajouté le commentaire :\n\n"
+ . S::v('bestalias')." a ajouté le commentaire :\n\n"
. Env::v('comm')."\n\n"
. "cf la discussion sur : ".$globals->baseurl."/admin/validate";
// }}}
// {{{ function trig()
-
+
protected function trig($msg)
{
global $page;
$page->trig($msg);
}
-
+
// }}}
// {{{ function get_typed_request()
// {{{ function _mail_body
abstract protected function _mail_body($isok);
-
+
// }}}
// {{{ function _mail_subj
abstract protected function _mail_subj();
-
+
// }}}
// {{{ function commit()
-
+
/** fonction à utiliser pour insérer les données dans x4dat
*/
abstract public function commit();
// }}}
// {{{ function formu()
-
+
/** nom du template qui contient le formulaire */
abstract public function formu();
public $old='';
public $public='private';
-
+
public $rules = "Interdire ce qui peut nous servir (virus@, postmaster@, ...),
les alias vulgaires, et les prenom.nom (sauf si c'est pour l'utilisateur prenom.nom).
Pas de contrainte pour les tirets ou les points, en revanche le souligné (_) est interdit";
// }}}
// {{{ function _mail_subj
-
+
protected function _mail_subj()
{
return "[Polytechnique.org] Récupération de {$this->m_prenom} {$this->m_nom} ({$this->m_promo})";
global $globals;
$email = $this->m_bestalias . '@' . $globals->mail->domain;
- XDB::execute("UPDATE emails AS e
+ XDB::execute("UPDATE emails AS e
INNER JOIN aliases AS a ON (a.id = e.uid)
SET e.flags = 'active'
WHERE a.alias = {?} AND e.email = {?}", $this->m_forlife, $this->m_email);
$mailer->send();
return true;
}
-
+
$email = $this->m_bestalias . '@' . $globals->mail->domain;
if ($this->old_email) {
$subject = "Ton adresse $email semble ne plus fonctionner";
} elseif (count($redirect) == 1) {
$reason .= ' car sa redirection vers ' . $redirect[0] . ' est hors-service depuis plusiers mois.';
} else {
- $reason .= ' car ses redirections vers ' . implode(', ', $redirect)
+ $reason .= ' car ses redirections vers ' . implode(', ', $redirect)
. ' sont hors-services depuis plusieurs mois.';
}
}
public $texte;
public $pmin;
public $pmax;
- public $peremption;
+ public $peremption;
public $comment;
public $imgtype;
public $imgx;
public $imgy;
public $img;
-
+
// }}}
// {{{ constructor
$this->comment = $_comment;
if ($upload) {
$this->readImage($upload);
- }
+ }
}
// }}}
// }}}
// {{{ function _mail_subj
-
+
protected function _mail_subj()
{
return "[Polytechnique.org/EVENEMENTS] Proposition d'événement";
class HomonymeReq extends Validate
{
// {{{ properties
-
+
public $loginbis;
public $warning = true;
// }}}
// {{{ constructor
-
+
public function __construct($_uid, $_loginbis, $_homonymes_forlife, $warning=true)
{
$this->warning = $warning;
$this->loginbis = $_loginbis;
$this->homonymes_forlife = $_homonymes_forlife;
}
-
+
// }}}
// {{{ title()
-
+
private function title()
{
return $this->warning?'alerte alias':'robot répondeur';
// }}}
// {{{ function _mail_body
-
+
protected function _mail_body($isok)
{
global $globals;
}
// }}}
// {{{ function commit()
-
+
public function commit()
{
require_once('homonymes.inc.php');
XDB::execute("UPDATE aliases SET type='homonyme',expire=NOW() WHERE alias={?}", $this->loginbis);
XDB::execute("REPLACE INTO homonymes (homonyme_id,user_id) VALUES({?},{?})", $this->uid, $this->uid);
}
-
+
return true;
}
class ListeReq extends Validate
{
// {{{ properties
-
+
public $liste;
public $desc;
Refuser également des listes qui pourraient nous servir (admin, postmaster,...)";
// }}}
// {{{ constructor
-
+
public function __construct($_uid, $_liste, $_desc, $_advertise, $_modlevel,
$_inslevel, $_owners, $_members, $_stamp=0)
{
parent::__construct($_uid, true, 'liste', $_stamp);
-
+
$this->liste = $_liste;
$this->desc = $_desc;
$this->advertise = $_advertise;
public $m_type;
public $m_data;
- public $rules = "Accepter si l'adresse mail parait correcte, et pas absurde (ou si le marketeur est de confiance). Si le
+ public $rules = "Accepter si l'adresse mail parait correcte, et pas absurde (ou si le marketeur est de confiance). Si le
demandeur marque sa propre adresse mail, refuser dans tous les cas.
- Ne pas marqueter au nom de Polytechnique.org plus d'une
+ Ne pas marqueter au nom de Polytechnique.org plus d'une
fois par an.";
// }}}
// {{{ constructor
FROM auth_user_md5 AS u
WHERE user_id = {?}
GROUP BY u.user_id', $mark_id);
- list ($this->m_nom, $this->m_prenom, $this->m_promo) = $res->fetchOneRow();
+ list ($this->m_nom, $this->m_prenom, $this->m_promo) = $res->fetchOneRow();
}
// }}}
// }}}
// {{{ function _mail_subj
-
+
protected function _mail_subj()
{
return "[Polytechnique.org] Marketing de {$this->m_prenom} {$this->m_nom} ({$this->m_promo})";
if ($market == null) {
return false;
}
- $market->send();
+ $market->send();
return true;
}
// {{{ function formu()
public function formu()
- {
+ {
return 'include/form.valid.medals.tpl';
}
{
//var_dump($this);
$r = XDB::query("
- SELECT IF (g.text IS NOT NULL, CONCAT(m.text,' - ', g.text), m.text)
+ SELECT IF (g.text IS NOT NULL, CONCAT(m.text,' - ', g.text), m.text)
FROM profile_medals AS m
LEFT JOIN profile_medals_grades AS g ON(g.mid = m.id AND g.gid = {?})
WHERE m.id = {?}", $this->gid, $this->mid);
- return $r->fetchOneCell();
+ return $r->fetchOneCell();
}
// }}}
public $art;
public $rules = "Laisser valider par le NL-MASTER";
-
+
// }}}
// {{{ constructor
// }}}
// {{{ function _mail_subj
-
+
protected function _mail_subj()
{
return "[Polytechnique.org/NL] Proposition d'article dans la NL";
public $homonyme;
public $reason;
-
- public $rules = "Refuser
- tout ce qui n'est visiblement pas un nom de famille (ce qui est
- extremement rare car à peu près n'importe quoi peut être un nom de
+
+ public $rules = "Refuser
+ tout ce qui n'est visiblement pas un nom de famille (ce qui est
+ extremement rare car à peu près n'importe quoi peut être un nom de
famille...)";
// }}}
public $promo;
public $promo_sortie;
-
+
public $rules = "A priori accepter (la validation sert à repousser les
- petits malins). Refuse si tu connais la personne et que tu es sure
+ petits malins). Refuse si tu connais la personne et que tu es sure
qu'elle n'est pas orange.";
// }}}
parent::__construct($_uid, true, 'orange');
$this->promo_sortie = $_sortie;
$res = XDB::query("SELECT promo FROM auth_user_md5 WHERE user_id = {?}", $_uid);
- $this->promo = $res->fetchOneCell();
+ $this->promo = $res->fetchOneCell();
}
// }}}
class PayReq extends Validate
{
// {{{ properties
-
+
public $titre;
public $site;
$where = "%".$wassoid."%".$wevt."%";
return $where;
}
-
+
// }}}
// {{{ function accept()
return true;
}
- // }}}
- // {{{ function submit()
-
+ // }}}
+ // {{{ function submit()
+
// supprime les demandes de paiments pour le meme evenement
public function submit()
{
// }}}
// {{{ function commit()
-
+
public function commit()
{
global $globals;
$id, $this->titre, $this->site,
$this->montant, $this->montant_min, $this->montant_max,
$this->bestalias."@".$globals->mail->domain, $this->msg_reponse, $this->asso_id);
- if ($this->asso_id && $this->evt)
+ if ($this->asso_id && $this->evt)
$ret = XDB::execute("UPDATE groupex.evenements SET paiement_id = {?} WHERE asso_id = {?} AND eid = {?}", $id, $this->asso_id, $this->evt);
return $ret;
private function read(PlUpload &$upload)
{
- $this->valid = $upload->resizeImage(240, 300, 160, 0, SIZE_MAX);
+ $this->valid = $upload->resizeImage(240, 300, 160, 0, SIZE_MAX);
if (!$this->valid) {
$this->trig('Le fichier que tu as transmis n\'est pas une image valide, ou est trop gros pour être traité');
}
list($this->x, $this->y, $this->mimetype) = $upload->imageInfo();
$upload->rm();
}
-
+
// }}}
// {{{ function isValid()
// }}}
// {{{ function _mail_subj
-
+
protected function _mail_subj()
{
return "[Polytechnique.org/SONDAGES] Proposition de sondage";
S::v('uid'),
$user['forlife'].'@'.$globals->mail->domain,
$user['forlife'].'@'.$globals->mail->domain2);
-
+
$user['virtualalias'] = $res->fetchOneCell();
$user['gpxs_vcardjoin'] = join(',', array_map(array('VCard', 'text_encode'), $user['gpxs_name']));
$user['binets_vcardjoin'] = join(',', array_map(array('VCard', 'text_encode'), $user['binets']));
$i++;
}
}
-
+
// on rajoute les numéros de tél
$adrid_index = array();
foreach ($array['adresse'] as $i => $a) $adrid_index[$a['adrid']] = $i;
foreach ($array['adresse'] as $i => $adr) {
unset($lasttel);
foreach($adr['tels'] as $j => $t){
- if (!isset($array['adresse'][$i]['tel']) && (strpos($t['tel_type'], 'Tél') === 0)) $array['adresse'][$i]['tel'] = $t['tel'];
+ if (!isset($array['adresse'][$i]['tel']) && (strpos($t['tel_type'], 'Tél') === 0)) $array['adresse'][$i]['tel'] = $t['tel'];
elseif (!isset($array['adresse'][$i]['fax']) && (strpos($t['tel_type'], 'Fax') === 0)) $array['adresse'][$i]['fax'] = $t['tel'];
else $lasttel = $t['tel'];
- if (isset($array['adresse'][$i]['tel']) && isset($array['adresse'][$i]['fax'])) break;
+ if (isset($array['adresse'][$i]['tel']) && isset($array['adresse'][$i]['fax'])) break;
}
if (!isset($array['adresse'][$i]['tel']) && isset($lasttel))
$array['adresse'][$i]['tel'] = $lasttel;
$args = array("erreur" => 1, "erreurstring" => $error_mat);
$reply = xmlrpc_encode_request(NULL,$args);
}
-
- return $reply;
-}
+
+ return $reply;
+}
function get_nouveau_infos($method, $params) {
global $error_mat, $error_key, $globals;
$res = XDB::query(
"SELECT a.nom, a.nom_usage,a.prenom, FIND_IN_SET('femme', a.flags) as femme ,a.deces!= 0 as decede ,
- a.naissance, a.promo, concat(al.alias, '@m4x.org') as mail
+ a.naissance, a.promo, concat(al.alias, '@m4x.org') as mail
FROM auth_user_md5 AS a
INNER JOIN aliases as al ON a.user_id=al.id
WHERE al.flags='bestalias' and a.matricule = {?}",$params[1]);
$data=$res->fetchOneAssoc();
//$data['mail'].='@polytechnique.org';
-
+
//on commence le cryptage des donnees
if (manageurs_encrypt_init($params[1]) == 1) {//on a pas trouve la cle pour crypter
$args = array("erreur" => 3, "erreurstring" => $error_key);
return false;
}
$file = wiki_work_dir().'/'.wiki_filename($pagename_dots);
- $cachefile = wiki_work_dir().'/cache_'.$pagename_dots.'.tpl';
+ $cachefile = wiki_work_dir().'/cache_'.$pagename_dots.'.tpl';
if (is_file($cachefile)) {
unlink($cachefile);
}
}
$groupname = substr($pagename_dots, 0, strpos($pagename_dots,'.'));
$newgroupname = substr($newname_dots, 0, strpos($pagename_dots,'.'));
-
+
$file = wiki_work_dir().'/'.wiki_filename($pagename_dots);
$newfile = wiki_work_dir().'/'.wiki_filename($newname_dots);
if (!is_file($file)) {
case 'rss': case 'atom': case 'sdf': case 'dc':
wiki_apply_feed_perms($perms[0]);
$feed = true;
- case '': case 'search':
+ case '': case 'search':
break;
case 'edit':
$url = '/' . str_replace('.', '/', $n) . '?action=rss';
if (S::logged()) {
$url .= '&user=' . S::v('forlife') . '&hash=' . S::v('core_rss_hash');
- }
+ }
$page->setRssLink($n, $url);
}
$Skin = 'empty';
@include_once("$FarmD/cookbook/e-protect.php");
-include_once($FarmD.'/scripts/xlpage-utf-8.php');
+include_once($FarmD.'/scripts/xlpage-utf-8.php');
ResolvePageName();
if ($action == 'rss' || $action == 'atom' || $action == 'rdf' || $action == 'dc') {
$GUIButtons['hr'] = array(540, '\\n----\\n', '', '',
'$GUIButtonDirUrlFmt/hr.gif"$[Horizontal rule]"');
$GUIButtons['table'] = array(600,
- '||border=1 width=80%\\n||!Hdr ||!Hdr ||!Hdr ||\\n|| || || ||\\n|| || || ||\\n', '', '',
+ '||border=1 width=80%\\n||!Hdr ||!Hdr ||!Hdr ||\\n|| || || ||\\n|| || || ||\\n', '', '',
'$GUIButtonDirUrlFmt/table.gif"$[Table]"');
// set default author
$Author = $_SESSION['forlife'].'|'.$_SESSION['prenom'].' '.$_SESSION['nom'];
$InputTags['e_form'] = array(
- ':html' => "<form action='{\$PageUrl}?action=edit' method='post'><div><input
- type='hidden' name='action' value='edit' /><input
- type='hidden' name='n' value='{\$FullName}' /><input
+ ':html' => "<form action='{\$PageUrl}?action=edit' method='post'><div><input
+ type='hidden' name='action' value='edit' /><input
+ type='hidden' name='n' value='{\$FullName}' /><input
type='hidden' name='basetime' value='\$EditBaseTime' /></div>");
// set profiles to point to plat/al fiche
## [[#anchor]] in standard XHTML
Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e',
"Keep(\"<a id='$1'></a>\",'L')");
-
+
Markup('tablebicol', '<block', '/\(:tablebicol ?([a-z_]+)?:\)/e', 'doBicol("$1")');
-Markup('pairrows', '_end', '/class=\'pair\_pmwiki\_([0-9]+)\'/e',
+Markup('pairrows', '_end', '/class=\'pair\_pmwiki\_([0-9]+)\'/e',
"($1 == 1)?'':('class=\"'.(($1 % 2 == 0)?'impair':'pair').'\"')");
Markup('noclassth', '_end', '/<th class=\'[a-z_]+\'/', '<th');
function doPlatalLink($link, $text)
{
- if (strlen(trim($text)) == 0) {
+ if (strlen(trim($text)) == 0) {
$res = XDB::query("SELECT u.nom, u.prenom, u.promo, q.profile_nick AS surnom
FROM auth_user_md5 AS u
INNER JOIN auth_user_quick AS q USING(user_id)
global $globals;
parent::changeTpl($tpl, $type);
$this->assign('is_logged', S::logged());
- if ($globals->asso('id')) {
+ if ($globals->asso('id')) {
$this->assign('asso', $globals->asso());
$this->setType($globals->asso('cat'));
$this->assign('is_admin', may_update());
$this->assign('is_member', is_member());
}
}
-
+
// }}}
// {{{ function setType
$sub = array();
$sub['liste des groupes'] = 'plan';
$sub['documentation'] = 'Xnet';
- $sub['signaler un bug'] = array('href' => 'send_bug', 'class' => 'popup_840x600');
+ $sub['signaler un bug'] = array('href' => 'send_bug', 'class' => 'popup_840x600');
$menu["no_title"] = $sub;
-
+
if (S::logged() && $globals->asso()) {
$sub = array();
$dim = $globals->asso('diminutif');
{
// {{{ function init
- public static function init()
+ public static function init()
{
global $globals;
// }}}
// {{{ doAuthX
- public static function doAuthX()
+ public static function doAuthX()
{
global $globals, $page;
// {{{ killSuid
public static function killSuid()
- {
+ {
if (!S::has('suid')) {
return;
}
/** Get membership informations for the current asso
* @param force Force membership to be read from database
* @param lose Force membership to be false
- */
+ */
function is_member($force = false, $lose = false)
{
if (!isset($_SESSION['is_member'])) {
return trim($output);
}
-/** vérifie si une adresse email convient comme adresse de redirection
+/** vérifie si une adresse email convient comme adresse de redirection
* @param $email l'adresse email a verifier
* @return BOOL
*/
function isvalid_email_redirection($email)
{
- return isvalid_email($email) &&
+ return isvalid_email($email) &&
!preg_match("/@(polytechnique\.(org|edu)|melix\.(org|net)|m4x\.org)$/", $email);
}
/** genere une chaine aleatoire convenable pour une url
* @param $len longueur souhaitée, 22 par défaut
- * @return la chaine aleatoire
+ * @return la chaine aleatoire
*/
function rand_url_id($len = 22)
{
'ô' => 'o', 'ö' => 'o', 'ò' => 'o', 'ó' => 'o', 'õ' => 'o', 'ø' => 'o',
'ú' => 'u', 'ù' => 'u', 'û' => 'u', 'ü' => 'u',
'ç' => 'c', 'ñ' => 'n');
-$uc_convert = array('É' => 'E', 'È' => 'E', 'Ë' => 'E', 'Ê' => 'E',
- 'Á' => 'A', 'À' => 'A', 'Ä' => 'A', 'Â' => 'A', 'Å' => 'A', 'Ã' => 'A',
- 'Ï' => 'I', 'Î' => 'I', 'Ì' => 'I', 'Í' => 'I',
- 'Ô' => 'O', 'Ö' => 'O', 'Ò' => 'O', 'Ó' => 'O', 'Õ' => 'O', 'Ø' => 'O',
- 'Ú' => 'U', 'Ù' => 'U', 'Û' => 'U', 'Ü' => 'U',
+$uc_convert = array('É' => 'E', 'È' => 'E', 'Ë' => 'E', 'Ê' => 'E',
+ 'Á' => 'A', 'À' => 'A', 'Ä' => 'A', 'Â' => 'A', 'Å' => 'A', 'Ã' => 'A',
+ 'Ï' => 'I', 'Î' => 'I', 'Ì' => 'I', 'Í' => 'I',
+ 'Ô' => 'O', 'Ö' => 'O', 'Ò' => 'O', 'Ó' => 'O', 'Õ' => 'O', 'Ø' => 'O',
+ 'Ú' => 'U', 'Ù' => 'U', 'Û' => 'U', 'Ü' => 'U',
'Ç' => 'C', 'Ñ' => 'N');
function replace_accent($string)
$accents['Ç'] = 'S';
$accents['¿'] = 'E';
}
- // Si il n'y a pas de mot, on sort immédiatement
- if ( $sIn === '' ) return ' ';
- // On supprime les accents
+ // Si il n'y a pas de mot, on sort immédiatement
+ if ( $sIn === '' ) return ' ';
+ // On supprime les accents
$sIn = strtr( $sIn, $accents);
- // On met tout en minuscule
- $sIn = strtoupper( $sIn );
- // On supprime tout ce qui n'est pas une lettre
- $sIn = preg_replace( '`[^A-Z]`', '', $sIn );
- // Si la chaîne ne fait qu'un seul caractère, on sort avec.
- if ( strlen( $sIn ) === 1 ) return $sIn . ' ';
- // on remplace les consonnances primaires
+ // On met tout en minuscule
+ $sIn = strtoupper( $sIn );
+ // On supprime tout ce qui n'est pas une lettre
+ $sIn = preg_replace( '`[^A-Z]`', '', $sIn );
+ // Si la chaîne ne fait qu'un seul caractère, on sort avec.
+ if ( strlen( $sIn ) === 1 ) return $sIn . ' ';
+ // on remplace les consonnances primaires
$sIn = str_replace( $convGuIn, $convGuOut, $sIn );
// on supprime les lettres répétitives
$sIn = preg_replace( '`(.)\1`', '$1', $sIn );
// on réinterprète les voyelles
$sIn = preg_replace( $convVIn, $convVOut, $sIn);
- // on supprime les terminaisons T, D, S, X (et le L qui précède si existe)
+ // on supprime les terminaisons T, D, S, X (et le L qui précède si existe)
$sIn = preg_replace( '`L?[TDSX]$`', '', $sIn );
// on supprime les E, A et Y qui ne sont pas en première position
$sIn = preg_replace( '`(?!^)Y([^AEOU]|$)`', '\1', $sIn);
$sIn = preg_replace( '`(?!^)[EA]`', '', $sIn);
- return substr( $sIn . ' ', 0, 4);
+ return substr( $sIn . ' ', 0, 4);
}
/** met les majuscules au debut de chaque atome du prénom
require_once 'emails.inc.php';
if (is_null($red)) {
$red = new Redirect(S::v('uid'));
- }
+ }
$_SESSION['no_redirect'] = !$red->other_active('');
- $_SESSION['mx_failures'] = $red->get_broken_mx();
+ $_SESSION['mx_failures'] = $red->get_broken_mx();
}
function send_warning_mail($title)
{
// {{{ public static function init
- public static function init()
+ public static function init()
{
S::init();
if (!S::has('uid')) {
* @param page the calling page (by reference)
*/
public static function doAuthCookie()
-
+
{
if (S::logged()) {
return true;
LEFT JOIN aliases AS a ON (a.id = u.user_id AND type= 'a_vie')
WHERE u.user_id = {?}", $login);
} else {
- $r = XDB::query("SELECT *, a.alias AS forlife,
+ $r = XDB::query("SELECT *, a.alias AS forlife,
FIND_IN_SET('watch', u.flags) AS watch, FIND_IN_SET('femme', u.flags) AS sexe,
(year(naissance) > promo - 15 or year(naissance) < promo - 25) AS naiss_err
FROM auth_user_md5 AS u
INNER JOIN aliases AS a ON ( a.id = u.user_id AND a.alias={?} AND type!='homonyme' )", $login);
- }
+ }
$mr = $r->fetchOneAssoc();
if (!is_numeric($login)) { //user has a forlife
XDB::execute("UPDATE emails
SET rewrite = ''
WHERE uid = {?} AND rewrite LIKE CONCAT({?}, '@%')",
- $mr['user_id'], $val);
+ $mr['user_id'], $val);
fix_bestalias($mr['user_id']);
$page->trig($val." a été supprimé");
}
$res = XDB::query($watch);
$new_fields = $res->fetchOneAssoc();
-
+
$mailer = new PlMailer("admin/mail_intervention.tpl");
$mailer->assign("user", S::v('forlife'));
$mailer->assign('old', $old_fields);
{
if (Env::has('promo')) {
if(Env::i('promo') > 1900 && Env::i('promo') < 2050) {
- $action = Env::v('valid_promo') == 'Ajouter des membres' ? 'add' : 'ax';
+ $action = Env::v('valid_promo') == 'Ajouter des membres' ? 'add' : 'ax';
pl_redirect('admin/promo/' . $action . '/' . Env::i('promo'));
} else {
$page->trig('Promo non valide');
}
}
}
-
+
if ($action == 'delete' && $wikipage != '') {
if (wiki_delete_page($wikipage)) {
$page->trig("La page ".$wikipage." a été supprimée.");
$page->trig("Impossible de supprimer la page ".$wikipage.".");
}
}
-
+
if ($action == 'rename' && $wikipage != '' && $wikipage2 != '' && $wikipage != $wikipage2) {
if ($changedLinks = wiki_rename_page($wikipage, $wikipage2)) {
$s = 'La page <em>'.$wikipage.'</em> a été déplacée en <em>'.$wikipage2.'</em>.';
}
function handler_ipwatch(&$page, $action = 'list', $ip = null)
- {
+ {
$page->changeTpl('admin/ipwatcher.tpl');
-
+
$states = array('safe' => 'Ne pas surveiller',
'unsafe' => 'Surveiller les inscriptions',
'dangerous' => 'Surveiller tous les accès',
Xdb::execute('INSERT IGNORE INTO ip_watch (ip, state, detection, last, uid, description)
VALUES ({?}, {?}, CURDATE(), NOW(), {?}, {?})',
trim(Post::v('ipN')), Post::v('stateN'), S::i('uid'), Post::v('descriptionN'));
- };
- break;
-
- case 'edit':
- Xdb::execute('UPDATE ip_watch
+ };
+ break;
+
+ case 'edit':
+ Xdb::execute('UPDATE ip_watch
SET state = {?}, last = NOW(), uid = {?}, description = {?}
WHERE ip = {?}', Post::v('stateN'), S::i('uid'), Post::v('descriptionN'), Post::v('ipN'));
break;
-
+
default:
if ($action == 'delete' && !is_null($ip)) {
Xdb::execute('DELETE FROM emails_watch WHERE ip = {?}', $ip);
$sql = "SELECT w.detection, w.state, w.last, w.description,
a1.alias AS edit, a2.alias AS forlife, s.host
FROM ip_watch AS w
- LEFT JOIN aliases AS a1 ON (a1.id = w.uid AND a1.type = 'a_vie')
+ LEFT JOIN aliases AS a1 ON (a1.id = w.uid AND a1.type = 'a_vie')
LEFT JOIN logger.sessions AS s ON (w.ip = s.ip)
LEFT JOIN aliases AS a2 ON (a2.id = s.uid AND a2.type = 'a_vie')
WHERE w.ip = {?}
$page->assign('ip', $props);
}
}
-
+
function handler_icons(&$page)
{
$page->changeTpl('admin/icons.tpl');
$table_editor->describe('privkey','clé privée',false);
$table_editor->describe('datafields','champs renvoyés',true);
$table_editor->apply($page, $action, $id);
- }
+ }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
if (isset($_GET['group'])) {
$res = XDB::query("SELECT perms
FROM groupex.membres
- INNER JOIN groupex.asso ON(id = asso_id)
+ INNER JOIN groupex.asso ON(id = asso_id)
WHERE uid = {?} AND diminutif = {?}",
S::v('uid'), $_GET['group']);
$perms = $res->fetchOneCell();
$select .= "<option value=\"$stamp\"$sel>{$i}h</option>\n";
}
$page->assign('echeance_time', $select);
- }
+ }
}
function handler_cancel(&$page, $force = null)
INNER JOIN auth_user_md5 AS u USING(user_id)
INNER JOIN aliases AS a ON (u.user_id = a.id AND a.type = 'a_vie')");
$page->assign('admins', $res);
-
+
$importer = new CSVImporter('axletter_ins');
$importer->registerFunction('user_id', 'email vers Id X.org', array($this, 'idFromMail'));
$importer->forceValue('hash', array($this, 'createHash'));
$user = $email;
$domain = $globals->mail->domain2;
} else {
- list($user, $domain) = explode('@', $email);
+ list($user, $domain) = explode('@', $email);
}
if ($domain != $globals->mail->domain && $domain != $globals->mail->domain2
&& $domain != $globals->mail->alias_dom && $domain != $globals->mail->alias_dom2) {
WHERE ni.last < {?} AND {$this->subscriptionWhere()}
AND (e.email IS NOT NULL OR ni.user_id = 0)
GROUP BY u.user_id";
- }
+ }
static public function subscriptionState($uid = null)
{
FROM axletter_ins
WHERE user_id={?}", $user);
return $res->fetchOneCell();
- }
-
+ }
+
static public function unsubscribe($uid = null, $hash = false)
{
$user = is_null($uid) ? S::v('uid') : $uid;
if (!is_numeric($uid)) {
$res = XDB::query("SELECT id FROM aliases WHERE alias = {?}", $uid);
$uid = $res->fetchOneCell();
- }
+ }
if (!$uid) {
return false;
}
}
static public function listSent()
- {
+ {
$res = XDB::query("SELECT IF(shortname IS NULL, id, shortname) as id, date, subject AS titre
FROM axletter
WHERE NOT (FIND_IN_SET('new', bits))
ORDER BY date DESC");
return $res->fetchAllAssoc();
}
-
+
static public function listAll()
- {
+ {
$res = XDB::query("SELECT IF(shortname IS NULL, id, shortname) as id, date, subject AS titre
FROM axletter
ORDER BY date DESC");
{
$req = XDB::query("
SELECT nom,mail,sig,if(FIND_IN_SET('threads',flags),'1','0'),
- IF(FIND_IN_SET('automaj',flags),'1','0')
+ IF(FIND_IN_SET('automaj',flags),'1','0')
FROM forums.profils
WHERE uid = {?}", S::v('uid'));
if (!(list($nom,$mail,$sig,$disp,$maj) = $req->fetchOneRow())) {
readfile('../htdocs/images/x.png');
exit();
}
-
+
function handler_html(&$page, $login = '')
{
$page->changeTpl('skin/common.bandeau.tpl', NO_SKIN);
readfile('../htdocs/css/bandeau.css');
exit();
}
-
+
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
if (isset($_SESSION['log'])) {
$_SESSION['log']->log("suid_start", "login by ".S::v('forlife'));
- }
+ }
$_SESSION['suid'] = $_SESSION;
$_SESSION['perms'] =& XorgSession::make_perms($level);
"SELECT alias
FROM virtual AS v
INNER JOIN virtual_redirect AS vr USING(vid)
- WHERE (redirect={?} OR redirect={?})
+ WHERE (redirect={?} OR redirect={?})
AND alias LIKE '%@{$globals->mail->alias_dom}'",
$forlife.'@'.$globals->mail->domain, $forlife.'@'.$globals->mail->domain2);
$page->assign('melix', $res->fetchOneCell());
FROM auth_user_quick, virtual
INNER JOIN virtual_redirect USING(vid)
WHERE ( redirect={?} OR redirect= {?} )
- AND alias LIKE '%@{$globals->mail->alias_dom}' AND user_id = {?}",
+ AND alias LIKE '%@{$globals->mail->alias_dom}' AND user_id = {?}",
$forlife.'@'.$globals->mail->domain,
$forlife.'@'.$globals->mail->domain2, S::v('uid'));
list($alias, $visibility) = $res->fetchOneRow();
FROM virtual
INNER JOIN virtual_redirect USING(vid)
WHERE (redirect={?} OR redirect={?})
- AND alias LIKE '%@{$globals->mail->alias_dom}'",
+ AND alias LIKE '%@{$globals->mail->alias_dom}'",
$forlife.'@'.$globals->mail->domain, $forlife.'@'.$globals->mail->domain2);
$melix = $res->fetchOneCell();
if ($melix) {
"SELECT e1.uid, e1.panne != 0 AS panne, count(e2.uid) AS nb_mails,
u.nom, u.prenom, u.promo, a.alias AS forlife
FROM emails as e1
- LEFT JOIN emails as e2 ON(e1.uid = e2.uid
+ LEFT JOIN emails as e2 ON(e1.uid = e2.uid
AND FIND_IN_SET('active', e2.flags)
AND e1.email != e2.email)
INNER JOIN auth_user_md5 as u ON(e1.uid = u.user_id)
$sql = "SELECT w.detection, w.state, w.last, w.description,
a1.alias AS edit, a2.alias AS forlife
FROM emails_watch AS w
- LEFT JOIN aliases AS a1 ON (a1.id = w.uid AND a1.type = 'a_vie')
+ LEFT JOIN aliases AS a1 ON (a1.id = w.uid AND a1.type = 'a_vie')
LEFT JOIN emails AS e ON (w.email = e.email)
LEFT JOIN aliases AS a2 ON (a2.id = e.uid AND a2.type = 'a_vie')
WHERE w.email = {?}
function handler_lost(&$page, $action = 'list', $email = null)
{
$page->changeTpl('emails/lost.tpl');
-
+
$page->assign('lost_emails', XDB::iterator('
SELECT u.user_id, a.alias
FROM auth_user_md5 AS u
} while ($priority && !$res->numRows());
if (!$res->numRows()) {
return null;
- }
+ }
return $res->fetchOneAssoc();
}
// annonces promos triées par présence d'une limite sur les promos
// puis par dates croissantes d'expiration
$promo = S::v('promo');
- $uid = S::i('uid');
+ $uid = S::i('uid');
$sql = "SELECT e.id,e.titre, ev.user_id IS NULL AS nonlu
FROM evenements AS e
LEFT JOIN evenements_vus AS ev ON (e.id = ev.evt_id AND ev.user_id = {?})
// cache les evenements lus et raffiche les evenements a relire
if ($action == 'read' && $eid) {
XDB::execute('DELETE evenements_vus.*
- FROM evenements_vus AS ev
+ FROM evenements_vus AS ev
INNER JOIN evenements AS e ON e.id = ev.evt_id
WHERE peremption < NOW()');
XDB::execute('REPLACE INTO evenements_vus VALUES({?},{?})',
}
function handler_rss(&$page, $user = null, $hash = null)
- {
+ {
require_once 'rss.inc.php';
-
+
$uid = init_rss('events/rss.tpl', $user, $hash);
-
+
$rss = XDB::iterator(
'SELECT e.id, e.titre, e.texte, e.creation_date, e.post_id, p.attachmime IS NOT NULL AS photo,
IF(u2.nom_usage = "", u2.nom, u2.nom_usage) AS nom, u2.prenom, u2.promo
{
$page->changeTpl('events/submit.tpl');
$page->addJsLink('ajax.js');
-
+
require_once('wiki.inc.php');
wiki_require_page('Xorg.Annonce');
}
}
- function handler_admin_events(&$page, $action = 'list', $eid = null)
+ function handler_admin_events(&$page, $action = 'list', $eid = null)
{
$page->changeTpl('events/admin.tpl');
$page->addJsLink('ajax.js');
$flags->addFlag('important');
} else {
$flags->rmFlag('important');
- }
+ }
XDB::execute('UPDATE evenements
- SET creation_date = creation_date,
+ SET creation_date = creation_date,
titre={?}, texte={?}, peremption={?}, promo_min={?}, promo_max={?},
flags = {?}
- WHERE id = {?}',
+ WHERE id = {?}',
Post::v('titre'), Post::v('texte'), Post::v('peremption'),
Post::v('promo_min'), Post::v('promo_max'),
$flags->flags(), $eid);
$eid, $type, $x, $y, $upload->getContents());
$upload->rm();
}
- }
+ }
}
if ($action == 'edit') {
$month=substr($p_stamp,4,2);
$day=substr($p_stamp,6,2);
- $select .= "<option value=\"$p_stamp\""
+ $select .= "<option value=\"$p_stamp\""
. (($p_stamp == strtr($peremption, array("-" => ""))) ? " selected" : "")
. "> $day / $month / $year</option>\n";
}
}
$page->assign('arch', $arch);
$page->assign('admin_evts', true);
- }
+ }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
$page->changeTpl('geoloc/admin.tpl');
require_once("geoloc.inc.php");
$page->assign('xorg_title','Polytechnique.org - Administration - Geolocalisation');
-
+
$nb_synchro = 0;
-
+
if (Env::has('id') && is_numeric(Env::v('id'))) {
if (synchro_city(Env::v('id'))) $nb_synchro ++;
}
-
+
if ($action == 'missinglat') {
$res = XDB::iterRow("SELECT id FROM geoloc_city WHERE lat = 0 AND lon = 0");
while ($a = $res->next()) if (synchro_city($a[0])) $nb_synchro++;
}
-
- if ($nb_synchro)
+
+ if ($nb_synchro)
$page->trig(($nb_synchro > 1)?($nb_synchro." villes ont été synchronisées"):"Une ville a été synchronisée");
-
+
$res = XDB::query("SELECT COUNT(*) FROM geoloc_city WHERE lat = 0 AND lon = 0");
$page->assign("nb_missinglat", $res->fetchOneCell());
}
-
+
function handler_admin_dynamap(&$page, $action = false) {
$page->changeTpl('geoloc/admin_dynamap.tpl');
-
+
if ($action == 'cities_not_on_map') {
require_once('geoloc.inc.php');
if (!fix_cities_not_on_map(20))
else
$refresh = true;
}
-
+
if ($action == 'smallest_maps') {
require_once('geoloc.inc.php');
set_smallest_levels();
}
-
+
if ($action == 'precise_coordinates') {
XDB::execute("UPDATE adresses AS a INNER JOIN geoloc_city AS c ON(a.cityid = c.id) SET a.glat = c.lat / 100000, a.glng = c.lon / 100000");
}
-
+
if ($action == 'newmaps') {
require_once('geoloc.inc.php');
if (!get_new_maps(Env::v('url')))
$page->trig("Impossible d'accéder aux nouvelles cartes");
}
-
+
$countMissing = XDB::query("SELECT COUNT(*) FROM geoloc_city AS c LEFT JOIN geoloc_city_in_maps AS m ON(c.id = m.city_id) WHERE m.city_id IS NULL");
$missing = $countMissing->fetchOneCell();
-
+
$countNoSmallest = XDB::query("SELECT SUM(IF(infos = 'smallest',1,0)) AS n FROM geoloc_city_in_maps GROUP BY city_id ORDER BY n");
$noSmallest = $countNoSmallest->fetchOneCell() == 0;
-
+
$countNoCoordinates = XDB::query("SELECT COUNT(*) FROM adresses WHERE cityid IS NOT NULL AND glat = 0 AND glng = 0");
$noCoordinates = $countNoCoordinates->fetchOneCell();
-
+
if (isset($refresh) && $missing) {
$page->assign("xorg_extra_header", "<meta http-equiv='Refresh' content='3'/>");
}
$page->assign("no_smallest", $noSmallest);
$page->assign("no_coordinates", $noCoordinates);
}
-
+
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
if (list($det) = $this->client->get_members($liste)) {
if (substr($liste,0,5) != 'promo' && ($det['ins'] || $det['priv'])
&& !$det['own'] && ($det['sub'] < 2)) {
- exit;
+ exit;
}
require_once('banana/ml.inc.php');
$banana = new MLBanana(S::v('forlife'), Array('listname' => $liste, 'domain' => $domain, 'action' => 'rss2'));
}
if (Env::has('sadd')) {
pl_redirect('lists/moderate/'.$liste);
- }
+ }
}
if (Post::has('moderate_mails') && Post::has('select_mails')) {
} else {
// On cherche les marketings précédents sur cette adresse
// email, en se restreignant au dernier mois
-
+
if (Marketing::get($uid, $email, true)) {
$page->assign('already', true);
} else {
$page->changeTpl('newsletter/admin.tpl');
$page->assign('xorg_title','Polytechnique.org - Administration - Newsletter : liste');
require_once("newsletter.inc.php");
-
+
if($new) {
Newsletter::create();
pl_redirect("admin/newsletter");
}
-
+
$page->assign('nl_list', Newsletter::listAll());
}
-
+
function handler_admin_nl_edit(&$page, $nid = 'last', $aid = null, $action = 'edit') {
$page->changeTpl('newsletter/edit.tpl');
$page->addCssLink('nl.css');
- $page->assign('xorg_title','Polytechnique.org - Administration - Newsletter : Edition');
+ $page->assign('xorg_title','Polytechnique.org - Administration - Newsletter : Edition');
require_once("newsletter.inc.php");
-
+
$nl = new NewsLetter($nid);
-
+
if($action == 'delete') {
$nl->delArticle($aid);
pl_redirect("admin/newsletter/edit/$nid");
}
-
+
if($aid == 'update') {
$nl->_title = Post::v('title');
$nl->_title_mail= Post::v('title_mail');
pl_redirect('admin/newsletter/edit/' . $nl->_id);
}
}
-
+
if(Post::v('save')) {
$art = new NLArticle(Post::v('title'), Post::v('body'), Post::v('append'),
$aid, Post::v('cid'), Post::v('pos'));
$nl->saveArticle($art);
pl_redirect("admin/newsletter/edit/$nid");
}
-
+
if($action == 'edit' && $aid != 'update') {
$eaid = $aid;
if(Post::has('title')) {
}
$page->assign('art', $art);
}
-
+
$page->assign_by_ref('nl',$nl);
}
'%grp/payment/cyber_return' => $this->make_hook('cyber_return', AUTH_PUBLIC),
'%grp/payment/paypal_return' => $this->make_hook('paypal_return', AUTH_PUBLIC),
'admin/payments' => $this->make_hook('admin', AUTH_MDP, 'admin'),
-
+
);
}
WHERE rcb.id='$champ906'");
if (list($rcb_text, $c_id, $c_text) = $res->fetchOneRow()) {
cb_erreur("erreur lors du paiement : $c_text ($c_id)");
- } else{
+ } else{
cb_erreur("erreur inconnue lors du paiement");
}
}
function handler_xnet_payment(&$page, $pid = null)
{
global $globals;
-
+
if (!is_null($pid)) {
return $this->handler_payment($page, $pid);
}
$page->changeTpl('payment/xnet.tpl');
-
+
$res = XDB::query(
"SELECT id, text, url
FROM {$globals->money->mpay_tprefix}paiements
$page->assign('trans', $trans);
$page->assign('event', $event);
}
-
+
function handler_admin(&$page, $action = 'list', $id = null) {
$page->assign('xorg_title','Polytechnique.org - Administration - Paiements');
$page->assign('title', 'Gestion des télépaiements');
$table_editor->describe('mail','email contact',true);
$table_editor->describe('confirmation','message confirmation',false);
$table_editor->apply($page, $action, $id);
- }
+ }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
// }}}
// {{{ constructor
-
+
function Payment($ref=-1)
{
global $globals;
FROM {$globals->money->mpay_tprefix}paiements WHERE id={?}", $r);
list($this->id, $this->text, $this->url, $flags, $this->mail,
$this->montant_min, $this->montant_max, $this->montant_def, $this->asso_id) = $res->fetchOneRow();
-
+
$this->montant_min = (float)$this->montant_min;
$this->montant_max = (float)$this->montant_max;
$this->flags = new Flagset($flags);
// }}}
// {{{ function check()
-
+
function check($value)
{
$v = (float)strtr($value, ',', '.');
$i = $id==-1 ? $globals->money->mpay_def_meth : $id;
$res = XDB::query("SELECT id,text,include FROM {$globals->money->mpay_tprefix}methodes WHERE id={?}", $i);
list($this->id, $this->text, $this->inc) = $res->fetchOneRow();
- }
+ }
// }}}
}
// }}}
// {{{ constructor
-
+
function CyberPayment($val)
{
$this->val = strtr(sprintf("%.02f", (float)$val), '.', ',');
var $urlform;
var $nomsite = "PayPal";
var $text;
-
+
var $infos;
// }}}
// {{{ constructor
-
+
function PayPal($val)
{
$this->val_number = $val;
'return' => $roboturl,
'cn' => 'Commentaires',
'no_shipping' => 1,
- 'cbt' => empty($GLOBALS['IS_XNET_SITE']) ?
+ 'cbt' => empty($GLOBALS['IS_XNET_SITE']) ?
'Revenir sur polytechnique.org' :
'Revenir sur polytechnique.net');
$_SESSION['password'] = $password = Post::v('response2');
- XDB::execute('UPDATE auth_user_md5
+ XDB::execute('UPDATE auth_user_md5
SET password={?}
WHERE user_id={?}', $password,
S::v('uid'));
{
$page->changeTpl('platal/acces_smtp.tpl');
$page->assign('xorg_title','Polytechnique.org - Acces SMTP/NNTP');
-
+
require_once 'wiki.inc.php';
wiki_require_page('Xorg.SMTPSécurisé');
wiki_require_page('Xorg.NNTPSécurisé');
$pass = Env::v('smtppass1');
$log = S::v('log');
- if (Env::v('op') == "Valider" && strlen($pass) >= 6
- && Env::v('smtppass1') == Env::v('smtppass2'))
+ if (Env::v('op') == "Valider" && strlen($pass) >= 6
+ && Env::v('smtppass1') == Env::v('smtppass2'))
{
XDB::execute('UPDATE auth_user_md5 SET smtppass = {?}
WHERE user_id = {?}', $pass, $uid);
$log->log("passwd_del");
}
- $res = XDB::query("SELECT IF(smtppass != '', 'actif', '')
+ $res = XDB::query("SELECT IF(smtppass != '', 'actif', '')
FROM auth_user_md5
WHERE user_id = {?}", $uid);
$page->assign('actif', $res->fetchOneCell());
$page->assign('ok', true);
- $url = rand_url_id();
- XDB::execute('INSERT INTO perte_pass (certificat,uid,created)
+ $url = rand_url_id();
+ XDB::execute('INSERT INTO perte_pass (certificat,uid,created)
VALUES ({?},{?},NOW())', $url, $uid);
$res = XDB::query('SELECT email
FROM emails
Si en cliquant dessus tu n'y arrives pas, copie intégralement l'adresse dans la barre de ton navigateur. Si tu n'as pas utilisé ce lien dans six heures, tu peux tout simplement recommencer cette procédure.
---
+--
Polytechnique.org
\"Le portail des élèves & anciens élèves de l'Ecole polytechnique\"
array('tel' => '', 'tel_pub' => 'private', 'tel_type' => 'Tél.', 'telid' => 0, 'new_tel' => true),
array('tel' => '', 'tel_pub' => 'private', 'tel_type' => 'Fax', 'telid' => 1, 'new_tel' => true));
} elseif (count($adr['tels']) < $nb_tel_max) {
- $adresses[$adrid]['tels'][] =
+ $adresses[$adrid]['tels'][] =
array('tel' => '', 'tel_pub' => 'private', 'tel_type' => 'Autre', 'telid' => generate_new_telid($adr), 'new_tel' => true);
}
}
***************************************************************************/
$uid = S::v('uid');
-
+
$res = XDB::query(
"SELECT text,id
FROM binets_ins, binets_def
break;
}
}
- return (
+ return (
($adr['adr1'] == '') && ($adr['adr2'] == '') && ($adr['adr3'] == '') &&
($adr['postcode'] == '') && ($adr['city'] == '') && ($adr['country'] == '00') &&
($emptytel)
t.adrid, telid, tel_type, t.tel_pub, t.tel
FROM tels AS t INNER JOIN adresses AS a ON(t.uid = a.uid AND t.adrid = a.adrid)
WHERE t.uid = {?} AND NOT FIND_IN_SET('pro',statut) ORDER BY t.adrid, tel_type DESC, telid"
-, S::v('uid', -1)
+, S::v('uid', -1)
);
while ($tel = $restels->next()) {
$adrid = $tel['adrid'];
foreach (Post::v('grade') as $mid=>$gid) {
XDB::execute('UPDATE profile_medals_sub SET gid={?} WHERE uid={?} AND mid={?}', $gid, S::v('uid'), $mid);
}
-}
+}
$res = XDB::query(
"SELECT m.id, m.text AS medal, m.type, m.img, s.gid
}
//recuperation des pays
-$res = XDB::iterRow("SELECT m.pid, p.pays
+$res = XDB::iterRow("SELECT m.pid, p.pays
FROM mentor_pays AS m
LEFT JOIN geoloc_pays AS p ON(m.pid = p.a2) WHERE m.uid = {?} LIMIT {?}", S::v('uid', -1), $max_mentor_pays);
$nb_mentor_pays = $res->total();
$adr['cityid'], $adr['country'], $adr['region'],
$adr['regiontxt'], $adr['pub'], $statut,
S::v('uid', -1), $adrid);
- $telsvalues = "";
+ $telsvalues = "";
foreach ($adr['tels'] as $tel) {
insert_new_tel($adrid, $tel);
}
- } else {
+ } else {
//c'est une mise à jour
XDB::execute("UPDATE adresses SET adr1 = {?}, adr2 = {?},
adr3 = {?}, postcode = {?}, city = {?}, cityid = {?},
foreach($telid_array as $current_telid)
if ($current_telid == $new_telid)
$new_telid ++;
- else
+ else
return $new_telid;//s'ils sont differents, il y a un trou dans la liste des telid donc new_telid convient
//si aucun convient, on retourne le plus grand des telid actuel + 1
return $new_telid;
function replace_ifset_tel($varname, $i, $t){
$tab = Env::v($varname.$t, Array());
if (isset($tab[$i]))
- $GLOBALS['adresses'][$i]['tels'][$t][$varname] = $tab[$i];
+ $GLOBALS['adresses'][$i]['tels'][$t][$varname] = $tab[$i];
}
function get_adr_arg($varname, $i) {
$adresses[$i]['nouvelle'] = 'ajout';
$adresses[$i]['adrid'] = $i;
}
-
+
replace_ifset_adr('secondaire', $i);
set_flag_adr('courrier', $i);
replace_ifset_adr('temporaire', $i);
replace_ifset_adr('country', $i);
replace_ifset_adr('region', $i);
replace_ifset_adr('pub', $i);
-
+
for ($telid = 0; $telid <= $nb_tel_max; $telid++) {
$tab = Env::v('telid'.$telid, Array());
if(isset($tab[$i])){ //ce telid etait donc present dans le formulaire
replace_tel($i, $telid);
}
}
-
+
if (!get_adr_arg('parsevalid', $i)) replace_ifset_adr('txt', $i);
$tab = Env::v('numero_formulaire', Array());
if($tab[$i])
$adresses[$i] = array_merge($adresses[$i], empty_address());
// localize new address
$new = get_address_infos($adresses[$i]['txt']);
- if (compare_addresses_text($adresses[$i]['txt'], $geotxt = get_address_text($new)) || get_adr_arg('parsevalid', $i))
+ if (compare_addresses_text($adresses[$i]['txt'], $geotxt = get_address_text($new)) || get_adr_arg('parsevalid', $i))
$adresses[$i] = array_merge($adresses[$i], $new);
else {
$adresses[$i] = array_merge($adresses[$i], cut_address($adresses[$i]['txt']));
$sub_state['backs'][] = $state;
if (count($sub_state['backs']) == 3) {
$alert .= "Tentative d'inscription tres hesitante - ";
- }
+ }
}
// Compatibility with old sources, keep it atm
$sub_state['nom'] = $nom;
$sub_state['prenom'] = $prenom;
$sub_state['ourmat'] = $ourmat;
- $sub_state['watch'] = $watch;
+ $sub_state['watch'] = $watch;
$sub_state['naissance_ini'] = $naiss;
XDB::execute(
. " - ip : {$logger->ip} ({$logger->host})\n"
. ($logger->proxy_ip ? " - proxy : {$logger->proxy_ip} ({$logger->proxy_host})\n" : "");
$mymail->setTxtBody($msg);
- $mymail->send();
+ $mymail->send();
}
Marketing::clear($uid);
$prenom = strtoupper(replace_accent($prenom));
$is_ok = strtoupper($_prenom) == strtoupper($prenom);
-
+
$tokens = preg_split("/[ \-']/", $nom, -1, PREG_SPLIT_NO_EMPTY);
$maxlen = 0;
"envoie un mail à <a href=\"mailto:support@{$globals->mail->domain}</a>\">" .
"support@{$globals->mail->domain}</a> en expliquant ta situation.";
}
-
+
$res = XDB::query('SELECT id, type, expire FROM aliases WHERE alias={?}', $mailorg);
if ( $res->numRows() ) {
$mailer->addCc('"Support Polytechnique.org" <support@' . $globals->mail->domain . '>');
$msg =
"Bonjour,\n\n".
-
+
"Un homonyme vient de s'inscrire. La politique de Polytechnique.org est de fournir des\n".
"adresses mail devinables, nous ne pouvons donc pas conserver ton alias '$mailorg' qui\n".
"correspond maintenant à deux personnes.\n\n".
-
+
"Tu gardes tout de même l'usage de cet alias pour un mois encore à compter de ce jour.\n\n".
-
+
"Lorsque cet alias sera désactivé, l'adresse $mailorg@polytechnique.org renverra vers un \n".
"robot qui indiquera qu'il y a plusieurs personnes portant le même nom ;\n".
"cela évite que l'un des homonymes reçoive des courriels destinés à l'autre.\n\n".
-
+
"Pour te connecter au site, tu pourras utiliser comme identifiant n'importe lequel de tes\n".
"autres alias :\n".
" ".join(', ', $als)."\n";
"Commence dès aujourd'hui à communiquer à tes correspondants la nouvelle adresse que tu comptes utiliser !\n\n".
-
+
"En nous excusant pour le désagrément occasionné,\n".
"Cordialement,\n\n".
-
+
"-- \n".
"L'équipe de Polytechnique.org\n".
"\"Le portail des élèves & anciens élèves de l'X\"";
$pass = rand_pass();
$pass_encrypted = hash_encrypt($pass_clair);
$hash = rand_url_id(12);
-
+
XDB::execute('UPDATE auth_user_md5 SET last_known_email={?} WHERE matricule = {?}', $email, $mat);
XDB::execute(
}
require_once dirname(__FILE__) . '/search/search.inc.php';
- $page->changeTpl('search/index.tpl');
+ $page->changeTpl('search/index.tpl');
$page->assign('xorg_title','Polytechnique.org - Annuaire');
}
$view->addMod('trombi', 'Trombinoscope', false, array('with_promo' => true));
$view->addMod('geoloc', 'Planisphère', false, array('with_annu' => 'search/adv'));
$view->apply('search/adv', $page, $action, $subaction);
-
+
if ($subaction) {
return;
}
$_REQUEST['q']);
if (!$q) exit();
- // try to look in cached results
+ // try to look in cached results
$cache = XDB::query('SELECT `result`
FROM `search_autocomplete`
WHERE `name` = {?} AND
echo $res;
die();
}
-
+
// default search
$q = preg_quote($q);
$unique = '`user_id`';
$beginwith = true;
$field2 = false;
$qsearch = $q;
-
+
switch ($type) {
case 'binetTxt':
$db = '`binets_def` INNER JOIN
$beginwith = false;
break;
case 'sectionTxt':
- $db = '`sections` INNER JOIN
+ $db = '`sections` INNER JOIN
`auth_user_md5` ON(`auth_user_md5`.`section` = `sections`.`id`)';
$field = '`sections`.`text`';
$realid = '`sections`.`id`';
echo $res;
exit();
}
-
+
function handler_list(&$page, $type = null, $idVal = null)
{
// Give the list of all values possible of type and builds a select input for it
$db = '`groupesx_def`';
break;
case 'nationalite':
- $db = '`geoloc_pays` INNER JOIN
+ $db = '`geoloc_pays` INNER JOIN
`auth_user_md5` ON (`geoloc_pays`.`a2` = `auth_user_md5`.`nationalite`)';
$field = 'IF(`nat`=\'\', `pays`, `nat`)';
$id = '`a2`';
case 'region':
$db = '`geoloc_region`';
$field = '`name`';
- $id = '`region`';
+ $id = '`region`';
if (isset($_REQUEST['country'])) {
$where .= ' WHERE `a2` = "'.$_REQUEST['country'].'"';
}
IF(n.nat=\'\',n.pays,n.nat) AS nat, n.a2 AS iso3166,
COUNT(em.email) > 0 AS actif,';
// hide private information if not logged
-if (S::logged())
+if (S::logged())
$globals->search->result_fields .='
q.profile_web AS web,
q.profile_mobile AS mobile,
// }}}
// {{{ function get_request()
- /** récupérer la requête de l'utilisateur
+ /** récupérer la requête de l'utilisateur
* on met une chaîne vide si le champ n'a pas été complété */
function get_request()
{
// {{{ function get_where_statement()
/** récupérer la clause correspondant au champ dans la clause WHERE de la requête
- * on parcourt l'ensemble des champs de la bdd de $fieldDbName et on associe
+ * on parcourt l'ensemble des champs de la bdd de $fieldDbName et on associe
* à chacun d'entre eux une clause spécifique
* la clause totale et la disjonction de ces clauses spécifiques */
function get_where_statement()
$this->value = $this->mapId;
$this->RefSField($_fieldFormName, $_fieldDbName, $_refTable, $_refAlias, $_refCondition, true, false);
}
-
+
function get_select_statement()
{
if ($this->mapId === '') return false;
// }}}
// {{{ constructor
- /** constructeur
+ /** constructeur
* compareField est un champ de formulaire très simple qui ne sert qu'à la construction de la
* clause WHERE de la promo */
function PromoSField($_fieldFormName, $_compareFieldFormName, $_fieldDbName, $_fieldResultName)
$firstnameField = new StringSField('firstname',array('u.prenom'),'');
}
$nicknameField = new StringSField('nickname',array('q.profile_nick'),'');
-
+
$promo1Field = new PromoSField('promo1','egal1',array('u.promo'),'');
$promo2Field = new PromoSField('promo2','egal2',array('u.promo'),'');
$womanField = new RefSField('woman',array('FIND_IN_SET(\'femme\',u.flags)+1'),'','','');
$fonctionField = new RefSField('fonction',array('en.fonction'),'entreprises','en','u.user_id=en.uid');
$secteurField = new RefSField('secteur',array('fm.secteur'),'entreprises','fm','u.user_id=fm.uid');
$cvField = new RefSField('cv',array('u.cv'),'','','',false);
-
+
$natField = new RefSField('nationalite',array('u.nationalite'),'','','');
$binetField = new RefSField('binet',array('b.binet_id'),'binets_ins','b','u.user_id=b.user_id');
$groupexField = new RefSField('groupex',array('g.gid'),'groupesx_ins','g','u.user_id=g.guid');
$sectionField = new RefSField('section',array('u.section'),'','','');
$schoolField = new RefSField('school',array('as.aid'),'applis_ins','`as`','u.user_id=as.uid');
$diplomaField = new RefSField('diploma',array('ad.type'),'applis_ins','ad','u.user_id=ad.uid');
-
+
$freeField = new RefSField('free',array('q.profile_freetext'),'','','',false);
-
- return array(
+
+ return array(
$nameField, $firstnameField, $nicknameField, $promo1Field,
$promo2Field, $womanField, $subscriberField, $aliveField,
$townField, $countryField, $regionField, $mapField, $entrepriseField,
TO_DAYS(date_ins)-TO_DAYS(NOW()),
".(-($jours+1)).") AS jour,
COUNT(user_id) AS nb
- FROM auth_user_md5
+ FROM auth_user_md5
WHERE perms IN ('admin','user')
GROUP BY jour");
TO_DAYS(date_ins)-TO_DAYS(NOW()),
".(-($jours+1)).") AS jour,
COUNT(user_id) AS nb
- FROM auth_user_md5
+ FROM auth_user_md5
WHERE promo = {?} AND perms IN ('admin','user')
GROUP BY jour", $promo);
} // }}}
}
// }}}
-
+
// {{{ function handler_ajax() : some ajax in editing a new question (for now, there may be a little more later)
function handler_ajax(&$page, $type)
{
}
}
// }}}
-
+
// {{{ function show_confirm() : calls the template to display a confirm form
function show_confirm(&$page, $message, $formaction, $formhidden = null)
{
}
exit;
}
-
+
function handler_index(&$page)
{
$page->nomenu = true;
$page->setType($cat);
}
-
+
function handler_autologin(&$page)
{
$allkeys = func_get_args();
LEFT JOIN groupex.evenements_participants AS ep ON(e.eid = ep.eid AND ei.item_id = ep.item_id)
LEFT JOIN virtual AS al ON(al.type = 'evt' AND al.alias = CONCAT(short_name, {?}))
LEFT JOIN virtual AS pl ON(pl.type = 'evt' AND pl.alias = CONCAT(short_name, {?}))
- WHERE (e.eid = {?} OR e.short_name = {?}) AND ei.item_id = {?} AND e.asso_id = {?}
+ WHERE (e.eid = {?} OR e.short_name = {?}) AND ei.item_id = {?} AND e.asso_id = {?}
GROUP BY ei.item_id",
'-absents@'.$globals->xnet->evts_domain,
'-participants@'.$globals->xnet->evts_domain,
IF(m.origine != 'X',m.sexe,FIND_IN_SET('femme', u.flags)) AS femme,
m.perms='admin' AS admin,
(m.origine = 'X') AS x,
- ep.uid, SUM(ep.paid) AS paid, SUM(nb) AS nb
+ ep.uid, SUM(ep.paid) AS paid, SUM(nb) AS nb
FROM groupex.evenements_participants AS ep
INNER JOIN groupex.evenements AS e ON (ep.eid = e.eid)
LEFT JOIN groupex.membres AS m ON ( ep.uid = m.uid AND e.asso_id = m.asso_id)
WHERE user_id = {?}", $user['uid']);
$user = array_merge($user, $res->fetchOneAssoc());
}
- return $user;
+ return $user;
} elseif ($dom == 'polytechnique.org' || $dom == 'm4x.org') {
$res = XDB::query(
"SELECT user_id AS uid, u.promo,
XDB::query('DELETE r.*
FROM groupex.announces_read AS r
INNER JOIN groupex.announces AS a ON a.id = r.announce_id
- WHERE peremption < CURRENT_DATE()');
+ WHERE peremption < CURRENT_DATE()');
XDB::query('INSERT INTO groupex.announces_read
VALUES ({?}, {?})',
Env::i('read'), S::i('uid'));
$page->setRssLink("Polytechnique.net :: {$globals->asso("nom")} :: News",
'rss/'.S::v('forlife') .'/'.S::v('core_rss_hash').'/rss.xml');
}
-
+
$page->register_modifier('wiki_to_html', array('MiniWiki','WikiToHTML'));
$page->assign('articles', $arts);
LEFT JOIN emails AS e ON ( e.flags = 'active' AND e.uid = m.uid)
WHERE m.asso_id = {?} $ini
AND (m.origine != 'X' OR u.perms != 'pending' OR m.email IS NOT NULL)
- GROUP BY m.uid
+ GROUP BY m.uid
ORDER BY $tri
LIMIT {?},{?}", $globals->asso('id'), $ofs*NB_PER_PAGE, NB_PER_PAGE);
$page->assign('ann', $ann);
{
pl_redirect('annuaire/geoloc');
}
-
+
function handler_vcard(&$page, $photos = null)
{
global $globals;
{
if (Env::has('right') && (may_update() || S::has('suid'))) {
switch (Env::v('right')) {
- case 'admin':
+ case 'admin':
XnetSession::killSuid();
break;
case 'anim':
is_member(true);
break;
case 'member':
- XnetSession::doSelfSuid();
+ XnetSession::doSelfSuid();
may_update(false, true);
is_member(true);
break;
$market = new Marketing($uid, $email, 'group', $globals->asso('nom'),
Env::v('market_from'), S::v('uid'));
$market->add();
- }
+ }
}
XDB::execute('INSERT INTO groupex.membres (uid, asso_id, origine, email)
VALUES ({?}, {?}, "X", {?})',
$promo_min = ($art['public'] ? 0 : $art['promo_min']);
$promo_max = ($art['public'] ? 0 : $art['promo_max']);
if (is_null($aid)) {
- $fulltext = $art['texte'];
- if (!empty($art['contact_html'])) {
- $fulltext .= "\n\n'''Contacts :'''\\\\\n" . $art['contact_html'];
+ $fulltext = $art['texte'];
+ if (!empty($art['contact_html'])) {
+ $fulltext .= "\n\n'''Contacts :'''\\\\\n" . $art['contact_html'];
}
$post = null;
if ($globals->asso('forum')) {
}
if (Post::v('valid') == 'Enregistrer' || Post::v('valid') == 'Annuler') {
pl_redirect("");
- }
+ }
if (empty($art) && !is_null($aid)) {
$res = XDB::query("SELECT a.*, u.nom, u.prenom, u.promo, l.alias AS forlife,
if ($events->total()) {
$page->assign('events', $events);
}
- }
+ }
$art['contact_html'] = @MiniWiki::WikiToHTML($art['contact_html']);
$page->assign('art', $art);
function get_all_redirects($membres, $mls, &$client)
{
global $globals;
-
+
$tos = array();
-
+
if (!empty($membres)) {
$membres = array_map(create_function('$str', 'return "\"$str\"";'), $membres);
$membres = join(',', $membres);
$nom = isset($user['nom']) ? $user['nom'] : "";
$pnom = isset($user['prenom']) ? $user['prenom'] : preg_replace('!@.*!u', '', $user['email']);
$to = isset($user['prenom']) ? "\"{$user['prenom']} {$user['nom']}\" <{$user['email']}>" : $user['email'];
-
+
$text = $body;
$text = preg_replace('!<cher>!i', $cher, $text);
$text = preg_replace('!<nom>!i', $nom, $text);
* File: block.min_perms.php
* Type: block
* Name: min_perms
- * Purpose:
+ * Purpose:
* -------------------------------------------------------------
*/
function smarty_block_tidy($params, $content, &$smarty)
return true;
}
- if ($test_reverse) {
- return display_address_isIdentity($idt, implode(' ', array_reverse(explode(' ', $value))), false);
+ if ($test_reverse) {
+ return display_address_isIdentity($idt, implode(' ', array_reverse(explode(' ', $value))), false);
}
return false;
}
if ($param['adr']['mobile'])
$txthtml .= "<div>\n<em>Tél : </em>\n<strong>".$param['adr']['mobile']."</strong>\n</div>\n";
if ($param['adr']['tels'] && count($param['adr']['tels'])) {
- foreach ($param['adr']['tels'] as $tel)
+ foreach ($param['adr']['tels'] as $tel)
$txthtml .= "<div>\n<em>".$tel['tel_type']." : </em>\n<strong>".$tel['tel']."</strong>\n</div>\n";
}
if (!$param['nodiv']) {
$order = $champ;
if ($group) {
$fields .= ',' . $group;
- $order = $group . ',' . $order;
- }
+ $order = $group . ',' . $order;
+ }
$sql = "SELECT $fields FROM $table AS t $join $where ORDER BY $order";
$res = XDB::iterRow($sql);
$sel = ' selected="selected"';
$html .= '<optgroup label="' . pl_entities($my_grp, ENT_QUOTES) . '">';
$optgrp = $my_grp;
}
- $html .= sprintf("<option value=\"%s\" %s>%s</option>\n",
+ $html .= sprintf("<option value=\"%s\" %s>%s</option>\n",
$my_id, ($valeur==$my_id?$sel:""), $my_text);
}
if (!is_null($optgrp)) {
/*
* Smarty plugin
- * -------------------------------------------------------------
+ * -------------------------------------------------------------
* File: insert.getNbIns.php
* Type: insert
* Name: getNbIns
- * Purpose:
+ * Purpose:
* -------------------------------------------------------------
*/
function smarty_insert_getNbIns($params, &$smarty)
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-
+
function smarty_insert_getNbNotifs($params, &$smarty)
{
if(S::logged()) {
FROM virtual AS v
INNER JOIN virtual_redirect USING(vid)
INNER JOIN aliases AS a ON(id={?} AND a.type='a_vie')
- WHERE redirect = CONCAT(a.alias, {?})
+ WHERE redirect = CONCAT(a.alias, {?})
OR redirect = CONCAT(a.alias, {?})",
$id, "@".$globals->mail->domain, "@".$globals->mail->domain2);
$alias = $res->fetchOneCell();
/*
* Smarty plugin
- * -------------------------------------------------------------
+ * -------------------------------------------------------------
* File: insert.mkStats.php
* Type: insert
* Name: mkStats
- * Purpose:
+ * Purpose:
* -------------------------------------------------------------
*/
function smarty_insert_mkStats($params, &$smarty)
sed -e 's!^\(.*\)@polytechnique.org!INSERT INTO newsletter_ins SELECT id FROM aliases WHERE alias="\1";!' | \
mysql x4dat
-echo "DELETE FROM aliases WHERE alias LIKE 'newsletter%';" | mysql x4dat
+echo "DELETE FROM aliases WHERE alias LIKE 'newsletter%';" | mysql x4dat
mlist.default_member_moderation = int(modlevel) is 2
mlist.generic_nonmember_action = int(modlevel) > 0
mlist.subscribe_policy = 2 * (int(inslevel) is 1)
-
+
mlist.owner = owners
-
+
mlist.subject_prefix = '['+listname+'] '
mlist.max_message_size = 0
+++ /dev/null
-../../bin/connect.db.inc.php
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2007 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 *
+ ***************************************************************************/
+
+ini_set('include_path',dirname(__FILE__).'/../include:' . dirname(__FILE__).'/../classes:/usr/share/php');
+
+require_once('xorg.inc.php');
+require_once('xorg.misc.inc.php');
+
+require_once 'xdb.php';
+
+$globals->baseurl = "https://www.polytechnique.org";
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
evolution-inscrits-mails, plot-graphs, mailParselog
- add symlinks :
in htdocs/stats : ln -s /home/web/stats/graph-* .
- in templates/stats : ln -s /home/web/stats/lastParselog* .
+ in templates/stats : ln -s /home/web/stats/lastParselog* .
"
* carva redirects are still in scripts/ but their path and name have changed.
--> the error page is scripts/webredirect_error.php
--> the redirect page is scripts/webredirect.php
-
+
* mailman : update the conf to use the mhonarc archiver
"
(*) apt-get install php4-gd2
add extension=gd.so in /etc/php/apache(2?)/php.ini
-
+
(*) apt-get install php-banana (may not be on public servers)
and add a rewrite rule on www.polytechnique.org (http and https) :
^/banana/([^/]*/.*)$ /usr/share/banana/\$1