[geeklog-cvs] geeklog-1.3/public_html/admin moderation.php,1.49,1.50 user.php,1.73,1.74

dhaun at iowaoutdoors.org dhaun at iowaoutdoors.org
Sat May 15 09:02:23 EDT 2004


Update of /var/cvs/geeklog-1.3/public_html/admin
In directory www:/tmp/cvs-serv25753/public_html/admin

Modified Files:
	moderation.php user.php 
Log Message:
Moved code to send the registration email to lib-user.php, thus avoiding having the same piece of code in users.php, admin/user.php and admin/moderation.php.
Also fixed sending of the registration email when batch-adding users.


Index: moderation.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/admin/moderation.php,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** moderation.php	9 Apr 2004 08:39:27 -0000	1.49
--- moderation.php	15 May 2004 13:02:21 -0000	1.50
***************
*** 602,624 ****
                  if ($nrows == 1) {
                      $A = DB_fetchArray($result);
-                     srand((double)microtime()*1000000);
-                     $passwd = rand();
-                     $passwd = md5($passwd);
-                     $passwd = substr($passwd,1,8);
-                     $passwd2 = md5($passwd);
-                     DB_change ($_TABLES['users'], 'passwd', "$passwd2",
-                                'username', $A['username']);
-                     DB_change ($_TABLES['users'], 'pwrequestid', "NULL",
-                                'username', $A['username']);
  
!                     $mailtext = "{$LANG04[15]}\n\n";
!                     $mailtext .= "{$LANG04[2]}: {$A['username']}\n";
!                     $mailtext .= "{$LANG04[4]}: $passwd\n\n";
!                     $mailtext .= "{$LANG04[14]}\n\n";
!                     $mailtext .= "{$_CONF["site_name"]}\n";
!                     $mailtext .= "{$_CONF['site_url']}\n";
! 
!                     $subject = $_CONF['site_name'] . ': ' . $LANG04[16];
!                     COM_mail ($A['email'], $subject, $mailtext);
                  }
                  break;
--- 602,607 ----
                  if ($nrows == 1) {
                      $A = DB_fetchArray($result);
  
!                     USER_createAndSendPassword ($A['username'], $A['email']);
                  }
                  break;

Index: user.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/admin/user.php,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -d -r1.73 -r1.74
*** user.php	14 Mar 2004 15:09:23 -0000	1.73
--- user.php	15 May 2004 13:02:21 -0000	1.74
***************
*** 453,457 ****
      // Setting this to true will cause import to print processing status to
      // webpage and to the error.log file
!     $verbose_import = false;
  
      // First, upload the file
--- 453,457 ----
      // Setting this to true will cause import to print processing status to
      // webpage and to the error.log file
!     $verbose_import = true;
  
      // First, upload the file
***************
*** 528,532 ****
                  DB_query("INSERT INTO {$_TABLES['usercomment']} (uid) VALUES ($uid)");
                  DB_query("INSERT INTO {$_TABLES['userinfo']} (uid) VALUES ($uid)");
!                 $retval .= emailpassword($u_name, 1);
  
                  PLG_createUser ($uid);
--- 528,532 ----
                  DB_query("INSERT INTO {$_TABLES['usercomment']} (uid) VALUES ($uid)");
                  DB_query("INSERT INTO {$_TABLES['userinfo']} (uid) VALUES ($uid)");
!                 emailpassword ($userName);
  
                  PLG_createUser ($uid);
***************
*** 564,590 ****
  }
  
! function emailpassword($username)
  {
!     global $_CONF, $_TABLES, $LANG04;
! 
!     $result = DB_query("SELECT email FROM {$_TABLES['users']} WHERE username = '$username'");
!     $nrows = DB_numRows($result);
!     if ($nrows == 1) {
!         srand((double)microtime()*1000000);
!         $passwd = rand();
!         $passwd = md5($passwd);
!         $passwd = substr($passwd,1,8);
!         $passwd2 = md5($passwd);
!         DB_change($_TABLES['users'],'passwd',"$passwd2",'username',$username);
!         $A = DB_fetchArray($result);
!         $mailtext = "{$LANG04[15]}\n\n";
!         $mailtext .= "{$LANG04[2]}: $username\n";
!         $mailtext .= "{$LANG04[4]}: $passwd\n\n";
!         $mailtext .= "{$LANG04[14]}\n\n";
!         $mailtext .= "{$_CONF["site_name"]}\n";
!         $mailtext .= "{$_CONF['site_url']}\n";
  
!         $subject = $_CONF['site_name'] . ': ' . $LANG04[16];
!         COM_mail ($A['email'], $subject, $mailtext);
      }
  
--- 564,574 ----
  }
  
! function emailpassword ($username)
  {
!     global $_TABLES;
  
!     $email = DB_getItem ($_TABLES['users'], 'email', "username = '$username'");
!     if (!empty ($email)) {
!         USER_createAndSendPassword ($username, $email);
      }
  




More information about the geeklog-cvs mailing list