Removes getuser.sh, uniformises code in bin/.
authorStéphane Jacob <sj@m4x.org>
Wed, 26 May 2010 18:37:15 +0000 (20:37 +0200)
committerStéphane Jacob <sj@m4x.org>
Wed, 26 May 2010 18:50:41 +0000 (20:50 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
bin/banana.feedgen.php
bin/banana.spoolgen.php
bin/check_security_fixes.py
bin/csv2sql.php
bin/getuser.sh [deleted file]
bin/lists.create_promo.php
bin/lists.make_tpl.sh
bin/lists.mhonarc_pipe.sh
bin/lists.rpc.py
bin/newsletter.send.php

index 41071fe..e588630 100755 (executable)
@@ -9,7 +9,7 @@
  ********************************************************************************/
 
 require_once 'connect.db.inc.php';
-require_once dirname(__FILE__).'/../include/banana/forum.inc.php';
+require_once dirname(__FILE__) . '/../include/banana/forum.inc.php';
 ini_set('memory_limit', '128M');
 
 Banana::$mbox_helper = $globals->banana->mbox_helper;
index ac18c35..1857df7 100755 (executable)
@@ -9,7 +9,7 @@
  ********************************************************************************/
 
 require_once 'connect.db.inc.php';
-require_once dirname(__FILE__).'/../include/banana/forum.inc.php';
+require_once dirname(__FILE__) . '/../include/banana/forum.inc.php';
 ini_set('memory_limit', '128M');
 
 Banana::$mbox_helper = $globals->banana->mbox_helper;
index 96925fe..ec73c22 100755 (executable)
@@ -25,10 +25,10 @@ patches.
 
 Important notice: do not execute this script directly from an automatic checkout
 of plat/al. It would be extremely unwise to execute it with root privileges from
-a place where everybody can change it !
+a place where everybody can change it!
 
 Usage (-w updates the local .htaccess to disable guilty working copies):
-  check_security_fixes.py [-w] -b REFERENCE_PLATAL PLATAL_TO_CHECK ...
+  check_security_fixes.py [-w] -b REFERENCE_PLATAL PLATAL_TO_CHECK...
 """
 
 import optparse
@@ -143,7 +143,7 @@ def SelfCheckIsLatestVersion(base_path):
   most deployment will want to execute this script with root privileges,
   which implies that this script is deployed in a safe directory, and not
   just executed from an automatically updated checkout of plat/al (how
-  unsafe would that be ...)."""
+  unsafe would that be...)."""
 
   base_script = os.path.join(base_path, 'bin/check_security_fixes.py')
   local_script = os.path.abspath(sys.argv[0])
index 46ea682..4dcea43 100755 (executable)
@@ -20,7 +20,7 @@
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-require_once(dirname(__FILE__) . '/../core/classes/csvimporter.php');
+require_once dirname(__FILE__) . '/../core/classes/csvimporter.php';
 
 // {{{ function showHelp()
 
@@ -86,13 +86,13 @@ $action          = CSV_INSERT;
 $keys            = 'id';
 
 processArgs();
-require_once(dirname(__FILE__) . '/../core/classes/xdb.php');
+require_once dirname(__FILE__) . '/../core/classes/xdb.php';
 
 $source          = file_get_contents($sourceName);
 $insert_relation = null;
 $update_relation = null;
 if (isset($includedFile)) {
-    require_once($includedFile);
+    require_once $includedFile;
 }
 
 $translater = new CSVImporter($table, $keys, !$debug);
diff --git a/bin/getuser.sh b/bin/getuser.sh
deleted file mode 100755 (executable)
index 30e6377..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-field=$1
-nom=$2
-promo=$3
-
-query="SELECT $field FROM auth_user_md5 AS u "
-where=""
-pos=0
-for i in $nom ; do
-  query="$query INNER JOIN search_name AS sn${pos} ON (u.user_id = sn${pos}.uid) "
-  [ "$where" != "" ] && where="$where AND"
-  where="${where} sn${pos}.token LIKE \"${i}%\""
-  pos=$((pos + 1))
-done
-if [ "${promo}" != "" ] ; then
-  [ "$where" != "" ] && where="$where AND "
-  where="${where} u.promo = $promo"
-fi
-query="${query} WHERE ${where} GROUP BY u.user_id"
-
-echo $query | mysql --default-character-set=utf8 -N x4dat
index a5cbed3..9032a7c 100755 (executable)
@@ -1,8 +1,8 @@
 #!/usr/bin/php5 -q
 <?php
 
-require_once(dirname(__FILE__) . '/connect.db.inc.php');
-require_once('validations.inc.php');
+require_once dirname(__FILE__) . '/connect.db.inc.php';
+require_once 'validations.inc.php';
 
 global $globals;
 
index 6a67231..a4813d9 100755 (executable)
@@ -1,4 +1,4 @@
-#! /bin/ash
+#!/bin/sh
 
 TEMPLATES='/etc/mailman/xorg'
 URL='http://listes.polytechnique.org'
index 603c089..8a0c7d3 100755 (executable)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/sh
 
 SPOOL=/var/spool/platal/archives/
 OUTDIR="${SPOOL}/$1/`date +'%Y/%m/'`"
index 5a559cd..9ed42d8 100755 (executable)
@@ -196,7 +196,7 @@ def to_forlife(email):
     if ( fqdn == PLATAL_DOMAIN ) or ( fqdn == PLATAL_DOMAIN2 ):
         res = mysql_fetchone("""SELECT  CONCAT(f.alias, '@%s'), a.full_name
                                   FROM  accounts AS a
-                            INNER JOIN  aliases  AS f ON (f.uid = a.uid AND f.type = 'a_vie')
+                            INNER JOIN  aliases  AS f  ON (f.uid = a.uid AND f.type = 'a_vie')
                             INNER JOIN  aliases  AS aa ON (aa.uid = a.uid AND aa.alias = '%s'
                                                            AND a.type != 'homonyme')
                                  WHERE  a.state = 'active'
index c1051dd..4b0d456 100755 (executable)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-require_once('connect.db.inc.php');
-require_once('plmailer.php');
-require_once('newsletter.inc.php');
+require_once 'connect.db.inc.php';
+require_once 'plmailer.php';
+require_once 'newsletter.inc.php';
 
 $opt = getopt('i:h');
 
-if(empty($opt['i']) || isset($opt['h'])) {
+if (empty($opt['i']) || isset($opt['h'])) {
     echo <<<EOF
 usage: send_nl.php -i nl_id
        sends the NewsLetter of id "id"