]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-chk_regs.php
Obsolete action=login removed from URLs
[mailer.git] / inc / modules / admin / what-chk_regs.php
index 253e3e386a63bf1540600d1006802858292f34b4..78ab8bca61fafbcd7be2ae2662e7545a44bb29b3 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
-{
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
@@ -42,24 +41,30 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
 ADD_DESCR ("admin", basename(__FILE__));
 
 // Check for accounts
-$query = SQL_QUERY("SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, user_hash FROM "._MYSQL_PREFIX."_user_data WHERE status='UNCONFIRMED' ORDER BY userid", __FILE__, __LINE__);
+$result = SQL_QUERY("SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, user_hash
+FROM `{!_MYSQL_PREFIX!}_user_data`
+WHERE `status`='UNCONFIRMED'
+ORDER BY userid ASC", __FILE__, __LINE__);
 
-if (SQL_NUMROWS($query) > 0) {
+if (SQL_NUMROWS($result) > 0) {
        // We have some (new?) registrations!
-       $SW = 2; $OUT = "";
-       while (list($uid, $gender, $sname, $fname, $email, $IP, $ref, $hash) = SQL_FETCHROW($query)) {
-               if ($ref > 0) $ref = ADMIN_USER_PROFILE_LINK($ref);
+       $OUT = ""; $SW = 2;
+       while ($content = SQL_FETCHARRAY($result)) {
+               // Add link to refid
+               if ($content['refid'] > 0) $content['refid'] = ADMIN_USER_PROFILE_LINK($content['refid']);
+
                // Prepare array for the row template
+               // @TODO Rewritings: sname->surname,fname->family,ip->REMOTE_ADDR,ref->refid,hash->user_hash in template
                $content = array(
                        'sw'     => $SW,
-                       'gender' => TRANSLATE_GENDER($gender),
-                       'sname'  => $sname,
-                       'fname'  => $fname,
-                       'email'  => "<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$email."</A>",
-                       'ip'     => $IP,
-                       'ref'    => $ref,
-                       'hash'   => $hash,
-                       'link'   => ADMIN_USER_PROFILE_LINK($uid),
+                       'gender' => TRANSLATE_GENDER($content['gender']),
+                       'sname'  => $content['surname'],
+                       'fname'  => $content['family'],
+                       'email'  => "<a href=\"".CREATE_EMAIL_LINK($content['email'], "user_data")."\">".$content['email']."</a>",
+                       'ip'     => $content['REMOTE_ADDR'],
+                       'ref'    => $content['refid'],
+                       'hash'   => $content['user_hash'],
+                       'link'   => ADMIN_USER_PROFILE_LINK($content['userid']),
                );
 
                // Load row template and switch color
@@ -67,16 +72,19 @@ if (SQL_NUMROWS($query) > 0) {
                $SW = 3 - $SW;
        }
 
-       // Free memory
-       SQL_FREERESULT($query);
+       // Remember rows
+       // @TODO Rewrite this constant
        define('__REG_ROWS', $OUT);
 
        // Load main template
        LOAD_TEMPLATE("admin_reg");
 } else {
        // No registrations left - or all has confirmed their email address... :-)
-       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ALL_CONFIRMED_EMAIL);
+       LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_ALL_CONFIRMED_EMAIL'));
 }
 
+// Free memory
+SQL_FREERESULT($result);
+
 //
 ?>