branched
[mailer.git] / 0.2.1 / inc / libs / user_functions.php
diff --git a/0.2.1/inc/libs/user_functions.php b/0.2.1/inc/libs/user_functions.php
deleted file mode 100644 (file)
index 4701307..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-<?php
-/************************************************************************
- * MXChange v0.2.1                                    Start: 07/16/2004 *
- * ===============                              Last change: 10/27/2004 *
- *                                                                      *
- * -------------------------------------------------------------------- *
- * File              : user_functions.php                               *
- * -------------------------------------------------------------------- *
- * Short description : Special functions for user extension             *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung  : Spezielle Funktionen fuer die user-Erweiterung   *
- * -------------------------------------------------------------------- *
- *                                                                      *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
- * For more information visit: http://www.mxchange.org                  *
- *                                                                      *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or    *
- * (at your option) any later version.                                  *
- *                                                                      *
- * This program is distributed in the hope that it will be useful,      *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
- * GNU General Public License for more details.                         *
- *                                                                      *
- * You should have received a copy of the GNU General Public License    *
- * along with this program; if not, write to the Free Software          *
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
- * MA  02110-1301  USA                                                  *
- ************************************************************************/
-
-// Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
-       require($INC);
-}
-
-function alpha($sortby, $colspan, $return=false)
-{
-       global $CONFIG;
-       if (empty($_GET['offset'])) $_GET['offset'] = "0";
-       $ADD = "&amp;page=".$_GET['page']."&amp;offset=".$_GET['offset'];
-       if (!empty($_GET['mode'])) $ADD .= "&amp;mode=".SQL_ESCAPE($_GET['mode']);
-
-       /* Creates the list of letters and makes them a link. */
-       $alphabet = array(_ALL2, "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", _OTHERS);
-       $num = count($alphabet) - 1;
-       $OUT = "";
-       while (list($counter, $ltr) = each($alphabet))
-       {
-               if ($_GET['letter'] == $ltr)
-               {
-                       // Current letter is letter from URL
-                       $OUT .= "<STRONG>".$ltr."</STRONG>";
-               }
-                else
-               {
-                       // Output link to letter
-                       $OUT .= "<A href=\"".URL."/modules.php?module=admin&amp;what=".$GLOBALS['what'];
-                       if (!empty($_GET['mode'])) $OUT .= "&amp;mode=".SQL_ESCAPE($_GET['mode']);
-                       $OUT .= "&amp;letter=".$ltr."&amp;sortby=".$sortby.$ADD."\">".$ltr."</A>";
-               }
-               if ((($counter / $CONFIG['user_alpha']) == round($counter / $CONFIG['user_alpha'])) && ($counter > 0))
-               {
-                       $OUT .= "&nbsp;]<BR>[&nbsp;";
-               }
-                elseif ( $counter != $num )
-               {
-                       $OUT .= "&nbsp;|&nbsp;";
-               }
-       }
-       define('__ALPHA_LIST', $OUT);
-
-       // Load template
-       $OUT = LOAD_TEMPLATE("admin_list_user_alpha", true);
-       if ($return)
-       {
-               // Return generated code
-               return $OUT;
-       }
-        else
-       {
-               // Output generated code
-               OUTPUT_HTML ($OUT);
-       }
-}
-//
-function SortLinks($letter, $sortby, $colspan, $return=false)
-{
-       $OUT = "";
-       if (empty($_GET['offset'])) $_GET['offset'] = "0";
-       $ADD = "&amp;page=".$_GET['page']."&amp;offset=".$_GET['offset'];
-       if (!empty($_GET['mode'])) $ADD .= "&amp;mode=".SQL_ESCAPE($_GET['mode']);
-
-       // Makes order by links..
-       if ($letter == "front") $letter = _ALL2;
-
-       // Prepare array with all possible sorters
-       $list = array(
-               'userid'                => _UID,
-               'family'                => FAMILY_NAME,
-               'email'         => ADDY,
-               'REMOTE_ADDR'   => REMOTE_IP
-       );
-
-       // Add nickname if extension is installed
-       if (EXT_IS_ACTIVE("nickname")) {
-               $list['nickname'] = NICKNAME;
-       }
-
-       foreach ($list as $sort=>$title) {
-               if ($sortby == $sort) {
-                       $OUT .= "<STRONG>".$title."</STRONG>&nbsp;|&nbsp;";
-               } else {
-                       $OUT .= "<A href=\"".URL."/modules.php?module=admin&amp;what=list_user&amp;letter=".$letter."&amp;sortby=".$sort.$ADD."\">".$title."</a>&nbsp;|&nbsp;";
-               }
-       }
-       define('__SORT_LIST', substr($OUT, 0, -13));
-
-       // Load template
-       $OUT = LOAD_TEMPLATE("admin_list_user_sort", true);
-       if ($return)
-       {
-               // Return code
-               return $OUT;
-       }
-        else
-       {
-               // Output code
-               OUTPUT_HTML ($OUT);
-       }
-}
-//
-function ADD_PAGENAV($PAGES, $offset, $show_form, $colspan,$return=false)
-{
-       if (!$show_form)
-       {
-               // Empty row
-               define('__FORM_HEADER', "<TR><TD colspan=\"".$colspan."\" class=\"seperator\">&nbsp;</TD></TR>");
-       }
-        else
-       {
-               // Load form for changing number of lines
-               define('__FORM_HEADER', LOAD_TEMPLATE("admin_list_user_sort_form", true));
-       }
-       if (!$show_form)
-       {
-               // Add line with bottom border
-               define('__FORM_FOOTER', "<TR><TD colspan=\"".__COLSPAN2."\" class=\"seperator bottom2\">&nbsp;</TD></TR>");
-       }
-        else
-       {
-               // Add line without bottom border
-               define('__FORM_FOOTER', "<TR><TD colspan=\"".__COLSPAN2."\" class=\"seperator bottom2\">&nbsp;</TD></TR>");
-       }
-
-       $OUT = "";
-       for ($page = 1; $page <= $PAGES; $page++)
-       {
-               if (($page == $_GET['page']) || ((empty($_GET['page'])) && ($page == "1")))
-               {
-                       $OUT .= "<STRONG>-";
-               }
-                else
-               {
-                       if (empty($_GET['letter'])) $_GET['letter'] = _ALL2;
-                       if (empty($_GET['sortby'])) $_GET['sortby'] = "userid";
-                       $OUT .= "<A href=\"".URL."/modules.php?module=admin&amp;what=".$GLOBALS['what'];
-                       if (!empty($_GET['mode'])) $OUT .= "&amp;mode=".SQL_ESCAPE($_GET['mode']);
-                       $OUT .= "&amp;letter=".$_GET['letter']."&amp;sortby=".$_GET['sortby']."&amp;page=".$page."&amp;offset=".$offset."\">";
-               }
-               $OUT .= $page;
-               if (($page == $_GET['page']) || ((empty($_GET['page'])) && ($page == "1")))
-               {
-                       $OUT .= "-</STRONG>";
-               }
-                else
-               {
-                       $OUT .= "</A>";
-               }
-               if ($page < $PAGES) $OUT .= "&nbsp;|&nbsp;";
-       }
-       define('__PAGENAV_LIST', $OUT);
-
-       // Load template
-       $OUT = LOAD_TEMPLATE("admin_list_user_pagenav", true);
-       if ($return)
-       {
-               // Return code
-               return $OUT;
-       }
-        else
-       {
-               // Output code
-               OUTPUT_HTML ($OUT);
-       }
-}
-// Create email link to user's account
-function USER_CREATE_EMAIL_LINK($email, $mod="admin")
-{
-       $locked = " AND status='CONFIRMED'";
-       if (IS_ADMIN()) $locked = "";
-       $result = SQL_QUERY_ESC("SELECT userid
-FROM "._MYSQL_PREFIX."_user_data
-WHERE email='%s'".$locked." LIMIT 1",
-        array($email), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == 1)
-       {
-               // Load userid
-               list($uid) = SQL_FETCHROW($result);
-
-               // Rewrite email address to contact link
-               $email = URL."/modules.php?module=".$mod."&amp;what=user_contct&amp;u_id=".bigintval($uid);
-       }
-
-       // Free memory
-       SQL_FREERESULT($result);
-
-       // Return rewritten (?) email address
-       return $email;
-}
-//
-?>