- new : external authentication in another users table. Previous users table

is divided between users (common properties with any web application) and
  user_infos (phpwebgallery specific informations). External table and
  fields can be configured.

- modification : profile.php is not reachable through administration anymore
  (not useful).

- modification : in profile.php, current password is mandatory only if user
  tries to change his password. Username can't be changed.

- deletion : of obsolete functions get_user_restrictions,
  update_user_restrictions, get_user_all_restrictions, is_user_allowed,
  update_user

- modification : $user['forbidden_categories'] equals at least "-1" so that
  category_id NOT IN ($user['forbidden_categories']) can always be used.

- modification : user_forbidden table becomes user_cache so that not only
  restriction informations can be stored in this table.


git-svn-id: http://piwigo.org/svn/trunk@808 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall
2005-08-08 20:52:19 +00:00
parent 8b97a8154e
commit 273884a652
23 changed files with 638 additions and 741 deletions
+8 -14
View File
@@ -40,11 +40,11 @@
* @param int category id to verify
* @return void
*/
function check_restrictions( $category_id )
function check_restrictions($category_id)
{
global $user,$lang;
global $user, $lang;
if ( in_array( $category_id, $user['restrictions'] ) )
if (in_array($category_id, explode(',', $user['forbidden_categories'])))
{
echo '<div style="text-align:center;">'.$lang['access_forbiden'].'<br />';
echo '<a href="'.add_session_id( './category.php' ).'">';
@@ -167,18 +167,12 @@ function count_user_total_images()
$query = '
SELECT COUNT(DISTINCT(image_id)) as total
FROM '.IMAGE_CATEGORY_TABLE;
if (count($user['restrictions']) > 0)
{
$query.= '
WHERE category_id NOT IN ('.$user['forbidden_categories'].')';
}
$query.= '
FROM '.IMAGE_CATEGORY_TABLE.'
WHERE category_id NOT IN ('.$user['forbidden_categories'].')
;';
$row = mysql_fetch_array(pwg_query($query));
return isset($row['total']) ? $row['total'] : 0;
list($total) = mysql_fetch_array(pwg_query($query));
return $total;
}
/**