/[drupal]/contributions/modules/sympal_scripts/maint_reset_su_pw.php
ViewVC logotype

Contents of /contributions/modules/sympal_scripts/maint_reset_su_pw.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Thu Jan 4 17:35:40 2007 UTC (2 years, 10 months ago) by ber
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
File MIME type: text/x-php
Added the $domain parameter to the drupal includer. Else all Superuser passwords would be reset.
1 #!/usr/bin/php
2 <?php
3 # Script to install a new Drupal site from commandline in a multisite
4 function maint_reset_su_pw_print_help() {
5 print "usage: maint_reset_supw.php domain password\n";
6 exit;
7 }
8
9
10 /**
11 * include the configuration settings.
12 */
13 include_once('script_settings.php');
14
15 /**
16 * include the parser
17 */
18 include_once('common.php');
19
20 /**
21 * This is where the action happens.
22 * Three functions are always ran: to create the directories, create the settings file and insert the data. The rest is pluggable.
23 * TODO we check for hardcoded variables. This should be made flexible, but kept secure....
24 */
25 if (($domain = $argv[1]) &&
26 ($password = $argv[2])) {
27 /**
28 * Include Drupal
29 */
30 include_once('drupal.php');
31 installer_include_drupal($domain);
32 db_query("UPDATE users SET pass = md5('%s')", $password);
33 print "\nPassword is reset\n";
34 }
35 else {
36 maint_reset_su_pw_print_help();
37 }
38
39 ?>

  ViewVC Help
Powered by ViewVC 1.1.2