Commit 3ee119d0 authored by Dries's avatar Dries

- Improvement: SQL improvements to the user module. Patch #44 and #45 by

  Gerhard.

- Improvement: CSS improvements.  Patch #40 by Al.

 (TODO: we might be able to simplify admin.css now both drupal.css and
 admin.css are included to render administration pages.  Tags like "body"
 and friends can probably be inherited.)
parent e756213b
......@@ -56,9 +56,6 @@ dt {
dd {
margin-bottom: 0.5em;
}
code, pre {
font-size: 12px;
}
#menu {
position: absolute;
left: 0px;
......
......@@ -15,8 +15,9 @@ th { text-align: left; padding-right: 1em; border-bottom:
.book hr { clear: both; border: 0; height: 1px; background-color: #888; color: #888; }
.book .title { font-weight: bold; font-size: 1.3em; }
.book .last-updated { font-size: 0.8em; margin-top: 0.25em; }
.book .body { margin: 1em 0 3em 0; }
.book .body { margin: 1em 0 1em 0; }
.book .links { clear: both; border-top: 1px solid #888; padding-top: 0.5em; }
.book .nav .links { margin-top: 2em; }
.book .nav { margin: 1em 0; clear: both; }
.book .nav .prev { float: left; width: 45%; padding-bottom: 0.5em; }
......@@ -33,6 +34,7 @@ th { text-align: left; padding-right: 1em; border-bottom:
padding: 1px; margin: 0; font-size: 0.8em; }
.container-inline div { display: inline; }
.container-inline div input { margin: 0; }
.form-item .description { font-size: 0.85em; }
.form-item .title { font-weight: bold; margin-top: 1.1em; margin-bottom: 1px; }
......@@ -77,3 +79,4 @@ th { text-align: left; padding-right: 1em; border-bottom:
tr.dark { background-color: #ddd; }
tr.light { background-color: #eee; }
pre { white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -o-pre-wrap; white-space: -pre-wrap;}
pre, code { font-size: 11px; }
This diff is collapsed.
This diff is collapsed.
......@@ -73,7 +73,7 @@ function user_load($array = array()) {
$query .= "u.$key = '". check_query($value) ."' AND ";
}
}
$result = db_query_range("SELECT u.*, r.name AS role FROM users u LEFT JOIN role r ON u.rid = r.rid WHERE $query u.status < 3", 0, 1);
$result = db_query_range("SELECT u.*, r.name AS role FROM role r INNER JOIN users u ON r.rid = u.rid WHERE $query u.status < 3", 0, 1);
$user = db_fetch_object($result);
if ($user->data && $data = unserialize($user->data)) {
......@@ -1585,12 +1585,12 @@ function user_admin_edit($edit = array()) {
function user_admin_account() {
$query = arg(3);
$queries = array("ORDER BY timestamp DESC", "ORDER BY u.uid DESC", "WHERE status = 0 ORDER BY u.uid DESC");
$queries = array("ORDER BY u.timestamp DESC", "ORDER BY u.uid DESC", "WHERE u.status = 0 ORDER BY u.uid DESC");
foreach (user_roles(1) as $key => $value) {
$queries[] = "WHERE r.name = '$value' ORDER BY u.uid DESC";
}
$result = pager_query("SELECT u.uid, u.name, u.timestamp FROM users u LEFT JOIN role r ON u.rid = r.rid ". $queries[$query ? $query : 0], 50);
$result = pager_query("SELECT u.uid, u.name, u.timestamp FROM role r INNER JOIN users u ON r.rid = u.rid ". $queries[$query ? $query : 0], 50);
$header = array(t("username"), t("last access"), t("operations"));
while ($account = db_fetch_object($result)) {
......
......@@ -73,7 +73,7 @@ function user_load($array = array()) {
$query .= "u.$key = '". check_query($value) ."' AND ";
}
}
$result = db_query_range("SELECT u.*, r.name AS role FROM users u LEFT JOIN role r ON u.rid = r.rid WHERE $query u.status < 3", 0, 1);
$result = db_query_range("SELECT u.*, r.name AS role FROM role r INNER JOIN users u ON r.rid = u.rid WHERE $query u.status < 3", 0, 1);
$user = db_fetch_object($result);
if ($user->data && $data = unserialize($user->data)) {
......@@ -1585,12 +1585,12 @@ function user_admin_edit($edit = array()) {
function user_admin_account() {
$query = arg(3);
$queries = array("ORDER BY timestamp DESC", "ORDER BY u.uid DESC", "WHERE status = 0 ORDER BY u.uid DESC");
$queries = array("ORDER BY u.timestamp DESC", "ORDER BY u.uid DESC", "WHERE u.status = 0 ORDER BY u.uid DESC");
foreach (user_roles(1) as $key => $value) {
$queries[] = "WHERE r.name = '$value' ORDER BY u.uid DESC";
}
$result = pager_query("SELECT u.uid, u.name, u.timestamp FROM users u LEFT JOIN role r ON u.rid = r.rid ". $queries[$query ? $query : 0], 50);
$result = pager_query("SELECT u.uid, u.name, u.timestamp FROM role r INNER JOIN users u ON r.rid = u.rid ". $queries[$query ? $query : 0], 50);
$header = array(t("username"), t("last access"), t("operations"));
while ($account = db_fetch_object($result)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment