From 50e2ba896a958d451e3e8a04364c5909082aaab9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Wed, 26 May 2010 20:37:15 +0200 Subject: [PATCH] Removes getuser.sh, uniformises code in bin/. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- bin/banana.feedgen.php | 2 +- bin/banana.spoolgen.php | 2 +- bin/check_security_fixes.py | 6 +++--- bin/csv2sql.php | 6 +++--- bin/getuser.sh | 22 ---------------------- bin/lists.create_promo.php | 4 ++-- bin/lists.make_tpl.sh | 2 +- bin/lists.mhonarc_pipe.sh | 2 +- bin/lists.rpc.py | 2 +- bin/newsletter.send.php | 8 ++++---- 10 files changed, 17 insertions(+), 39 deletions(-) delete mode 100755 bin/getuser.sh diff --git a/bin/banana.feedgen.php b/bin/banana.feedgen.php index 41071fe..e588630 100755 --- a/bin/banana.feedgen.php +++ b/bin/banana.feedgen.php @@ -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; diff --git a/bin/banana.spoolgen.php b/bin/banana.spoolgen.php index ac18c35..1857df7 100755 --- a/bin/banana.spoolgen.php +++ b/bin/banana.spoolgen.php @@ -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; diff --git a/bin/check_security_fixes.py b/bin/check_security_fixes.py index 96925fe..ec73c22 100755 --- a/bin/check_security_fixes.py +++ b/bin/check_security_fixes.py @@ -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]) diff --git a/bin/csv2sql.php b/bin/csv2sql.php index 46ea682..4dcea43 100755 --- a/bin/csv2sql.php +++ b/bin/csv2sql.php @@ -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 index 30e6377..0000000 --- a/bin/getuser.sh +++ /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 diff --git a/bin/lists.create_promo.php b/bin/lists.create_promo.php index a5cbed3..9032a7c 100755 --- a/bin/lists.create_promo.php +++ b/bin/lists.create_promo.php @@ -1,8 +1,8 @@ #!/usr/bin/php5 -q