com web/doc: More cleaning after user removal: include/lib_au th.inc.php include/lib_proj_lang.inc.php templa tes/all/www/userlist.tpl.php templates/all/www/users.tp l.php

[email protected]
Newsgroups php.doc.web
Message-ID <[email protected]>
Commit:    08ac9d2f08cb944691d46c7fc71024e000f3d9ae
Author:    Sobak <[email protected]>         Sun, 16 Mar 2014 16:57:11 +0100
Parents:   8e7485ece693d7c57639a30f819d63e9719e818a
Branches:  master

Link:       http://git.php.net/?p=web/doc.git;a=commitdiff;h=08ac9d2f08cb944691d46c7fc71024e000f3d9ae

Log:
More cleaning after user removal

Changed paths:
  M  include/lib_auth.inc.php
  M  include/lib_proj_lang.inc.php
  D  templates/all/www/userlist.tpl.php
  D  templates/all/www/users.tpl.php


Diff:
diff --git a/include/lib_auth.inc.php b/include/lib_auth.inc.php
index f3669b9..d948fc4 100644
--- a/include/lib_auth.inc.php
+++ b/include/lib_auth.inc.php
@@ -70,12 +70,6 @@ function is_admin()
 function user_name($user = false)
 {
     $user = $user ? $user : $GLOBALS['user'];
-
-    // first check if the name is in the DB
-    if ($info = user_info($user))
-        return $info['name'];
-
-    //no, it isn't. fetch it from the master server
     return master_user_name($user);
 }
 
diff --git a/include/lib_proj_lang.inc.php b/include/lib_proj_lang.inc.php
index 0ba9b28..0ac5e0c 100644
--- a/include/lib_proj_lang.inc.php
+++ b/include/lib_proj_lang.inc.php
@@ -68,68 +68,4 @@ $LANGUAGES = array(
     'sv'    => 'Swedish',
     'tr'    => 'Turkish',
     'en'    => 'English',
-);
-
-$COUNTRIES = array(
-    "US" => "United States",
-    "AI" => "Anguilla",
-    "AR" => "Argentina",
-    "AU" => "Australia",
-    "AT" => "Austria",
-    "BY" => "Belarus",
-    "BE" => "Belgium",
-    "BR" => "Brazil",
-    "BG" => "Bulgaria",
-    "CA" => "Canada",
-    "CL" => "Chile",
-    "C2" => "China",
-    "CR" => "Costa Rica",
-    "CY" => "Cyprus",
-    "CZ" => "Czech Republic",
-    "DK" => "Denmark",
-    "DO" => "Dominican Republic",
-    "EC" => "Ecuador",
-    "EE" => "Estonia",
-    "FI" => "Finland",
-    "FR" => "France",
-    "DE" => "Germany",
-    "GR" => "Greece",
-    "HK" => "Hong Kong",
-    "HU" => "Hungary",
-    "IS" => "Iceland",
-    "IN" => "India",
-    "IE" => "Ireland",
-    "IL" => "Israel",
-    "IT" => "Italy",
-    "JM" => "Jamaica",
-    "JP" => "Japan",
-    "LV" => "Latvia",
-    "LT" => "Lithuania",
-    "LU" => "Luxembourg",
-    "MY" => "Malaysia",
-    "MT" => "Malta",
-    "MX" => "Mexico",
-    "NL" => "Netherlands",
-    "NZ" => "New Zealand",
-    "NO" => "Norway",
-    "PL" => "Poland",
-    "PT" => "Portugal",
-    "RU" => "Russia",
-    "RS" => "Serbia",
-    "SG" => "Singapore",
-    "SK" => "Slovakia",
-    "SI" => "Slovenia",
-    "ZA" => "South Africa",
-    "KR" => "South Korea",
-    "ES" => "Spain",
-    "SE" => "Sweden",
-    "CH" => "Switzerland",
-    "TW" => "Taiwan",
-    "TH" => "Thailand",
-    "TR" => "Turkey",
-    "GB" => "United Kingdom",
-    "UY" => "Uruguay",
-    "VE" => "Venezuela",
-);
-
-?>
+);
\ No newline at end of file
diff --git a/templates/all/www/userlist.tpl.php b/templates/all/www/userlist.tpl.php
deleted file mode 100644
index 43d985f..0000000
--- a/templates/all/www/userlist.tpl.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-global $data, $COUNTRIES;
-
-echo <<< HTML
-<table border="1">
- <tr>
-  <td>&docweb.users.username;</td>
-  <td>&docweb.users.name;</td>
-  <td>&docweb.users.country;</td>
- </tr>
-HTML;
-
-
-foreach ($data as $user) {
-
-    $user['country'] = empty($user['country']) ? '&nbsp;' : $COUNTRIES[$user['country']];
-
-    echo <<< HTML
- <tr>
-  <td><a href="/user/$user[username]">$user[username]</a></td>
-  <td>$user[name]</td>
-  <td>$user[country]</td>
- </tr>
-HTML;
-
-}
-
-echo '</table>';
-?>
diff --git a/templates/all/www/users.tpl.php b/templates/all/www/users.tpl.php
deleted file mode 100644
index 3c6a918..0000000
--- a/templates/all/www/users.tpl.php
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-global $info, $doEdit, $pictureError;
-
-if (isset($doEdit)) {
-
-if ($GLOBALS['user'] == $GLOBALS['userid']) {
-// only edit yourself
-
-switch ($pictureError) {
-    case 'succes':
-        $errors = "&docweb.users.succes;";
-    break;
-    case 'format':
-        $errors = "&docweb.users.error.format;<br />&docweb.users.error.size;";
-    break;
-    default:
-        $errors = '';
-}
-$countries = '';
-foreach ($GLOBALS['COUNTRIES'] as $code => $cntry) {
-if ($info['country'] == $code) {
-    $selected = ' selected="selected" ';
-} else {
-    $selected = '';
-}
-    $countries .= "<option value=\"".$code."\"$selected>".$cntry."</option>\n";
-}
-
-if (is_file($_SERVER['DOCUMENT_ROOT'] . '/images/users/' . $info['username'] . '.jpg')) {
-    $currentphoto = '<tr><td>&nbsp;</td><td><input type="checkbox" name="deletephoto" />&docweb.users.delete-photo;</td></tr>';
-} else {
-    $currentphoto = '';
-}
-echo <<< HTML
-<h3>$info[name], you can edit your info here</h3>
-$errors
-<form enctype="multipart/form-data" action="$_SERVER[REQUEST_URI]" method="post">
-<table>
-<tr><td>&docweb.users.name;</td><td>
-    <input type="text" name="name" value="$info[name]" /></td></tr>
-<tr><td>&docweb.users.country;</td><td>
-<select name="country">
-<option value="">Please Select</option>
-$countries
-</select></td></tr>
-<tr><td>&docweb.users.website;</td><td>
-    <input type="text" name="site" value="$info[site]" /></td></tr>
-<tr><td>&docweb.users.wishlist;</td><td>
-    <input type="text" name="wishlist" value="$info[wishlist]" /></td></tr>
-<tr><td>&docweb.users.photo;</td><td><input type="file" name="photo"/></td></tr>
-$currentphoto
-<tr><td>&nbsp;</td><td><input type="submit" name="editSubmit" value="&docweb.common.submit;"></td></tr>
-</table>
-</form>
-HTML;
-
-} else {
-echo '<h3>&docweb.users.error.notyou;</h3>';
-}
-
-} else {
-if ($info['country'] != '') {
-$cntrycode = $GLOBALS['COUNTRIES'][$info['country']];
-} else {
-$cntrycode = '';
-}
-echo <<< HTML
-<p><strong>&docweb.users.username;</strong>: $info[username]<br />
-<strong>&docweb.users.name;</strong>: $info[name]<br />
-<strong>&docweb.users.country;</strong>: $cntrycode<br />
-<strong>&docweb.users.website;</strong>: <a href="$info[site]">$info[site]</a><br />
-HTML;
-
-if ($info['wishlist'])
-    echo "<a href='$info[wishlist]'>&docweb.users.wishlist;</a><br />";
-
-if (is_file($_SERVER['DOCUMENT_ROOT'] . '/images/users/' . $info['username'] . '.jpg'))
-    echo "<img src='/images/users/$info[username].jpg' alt='&docweb.users.photo;'/>";
-
-echo '</p>';
-
-if ($GLOBALS['user'] == $GLOBALS['userid']) {
-    echo '<p><a href="'.$info['username'].'/edit">Edit Your profile</a>';
-}
-
-}
-?>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.