aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorgweltas <gweltas@piwigo.org>2004-12-02 15:42:57 +0000
committergweltas <gweltas@piwigo.org>2004-12-02 15:42:57 +0000
commitb35dc19ab6da173cc663e49cb32389d7e6dbfdee (patch)
tree1f069c9dea705fd4a6b8c0e4ce8151027ba77433 /include
parent19be28e4150ea71c70be8d22f1decc6a38ccf110 (diff)
Update of the user preferences panel.
Deletion of some PREFIX_TABLE occurences git-svn-id: http://piwigo.org/svn/trunk@630 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/functions_category.inc.php2
-rw-r--r--include/functions_group.inc.php9
-rw-r--r--include/functions_user.inc.php36
3 files changed, 4 insertions, 43 deletions
diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php
index d2e3b44ad..34025a704 100644
--- a/include/functions_category.inc.php
+++ b/include/functions_category.inc.php
@@ -546,7 +546,7 @@ SELECT COUNT(DISTINCT(id)) AS nb_total_images
$query = 'SELECT COUNT(DISTINCT(id)) AS nb_total_images';
$query.= ' FROM '.IMAGES_TABLE;
- $query.= ' INNER JOIN '.PREFIX_TABLE.'image_category AS ic';
+ $query.= ' INNER JOIN '.IMAGE_CATEGORY_TABLE.'AS ic';
$query.= ' ON id = ic.image_id';
$query.= $page['where'];
$query.= ';';
diff --git a/include/functions_group.inc.php b/include/functions_group.inc.php
index 8fc6408ad..b02b005f1 100644
--- a/include/functions_group.inc.php
+++ b/include/functions_group.inc.php
@@ -30,8 +30,7 @@
function get_group_restrictions( $group_id )
{
// 1. retrieving ids of private categories
- $query = 'SELECT id';
- $query.= ' FROM '.PREFIX_TABLE.'categories';
+ $query = 'SELECT id FROM '.CATEGORIES_TABLE;
$query.= " WHERE status = 'private'";
$query.= ';';
$result = pwg_query( $query );
@@ -42,8 +41,7 @@ function get_group_restrictions( $group_id )
}
// 2. retrieving all authorized categories for the group
$authorized = array();
- $query = 'SELECT cat_id';
- $query.= ' FROM '.PREFIX_TABLE.'group_access';
+ $query = 'SELECT cat_id FROM '.GROUP_ACCESS_TABLE;
$query.= ' WHERE group_id = '.$group_id;
$query.= ';';
$result = pwg_query( $query );
@@ -88,8 +86,7 @@ function is_group_allowed( $category_id, $restrictions )
$is_root = false;
while ( !$is_root and !in_array( $category_id, $restrictions ) )
{
- $query = 'SELECT id_uppercat';
- $query.= ' FROM '.PREFIX_TABLE.'categories';
+ $query = 'SELECT id_uppercat FROM '.CATEGORIES_TABLE;
$query.= ' WHERE id = '.$category_id;
$query.= ';';
$row = mysql_fetch_array( pwg_query( $query ) );
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index 9befa6596..1ac224c31 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -116,42 +116,6 @@ function register_user( $login, $password, $password_conf,
}
$query.= ');';
pwg_query( $query );
- // 3. retrieving the id of the newly created user
- $query = 'SELECT id';
- $query.= ' FROM '.USERS_TABLE;
- $query.= " WHERE username = '".$login."';";
- $row = mysql_fetch_array( pwg_query( $query ) );
- $user_id = $row['id'];
- // 4. adding access to the new user, the same as the user "guest"
- $query = 'SELECT cat_id';
- $query.= ' FROM '.PREFIX_TABLE.'user_access as ua';
- $query.= ','.PREFIX_TABLE.'users as u ';
- $query.= ' where u.id = ua.user_id';
- $query.= " and u.username = 'guest';";
- $result = pwg_query( $query );
- while( $row = mysql_fetch_array( $result ) )
- {
- $query = 'INSERT INTO '.PREFIX_TABLE.'user_access';
- $query.= ' (user_id,cat_id) VALUES';
- $query.= ' ('.$user_id.','.$row['cat_id'].');';
- pwg_query ( $query );
- }
- // 5. associate new user to the same groups that the guest
- $query = 'SELECT group_id';
- $query.= ' FROM '.PREFIX_TABLE.'user_group AS ug';
- $query.= ', '.PREFIX_TABLE.'users AS u';
- $query.= " WHERE u.username = 'guest'";
- $query.= ' AND ug.user_id = u.id';
- $query.= ';';
- $result = pwg_query( $query );
- while( $row = mysql_fetch_array( $result ) )
- {
- $query = 'INSERT INTO '.PREFIX_TABLE.'user_group';
- $query.= ' (user_id,group_id) VALUES';
- $query.= ' ('.$user_id.','.$row['group_id'].')';
- $query.= ';';
- pwg_query ( $query );
- }
}
return $error;
}