- 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

View File

@@ -130,12 +130,12 @@ SELECT DISTINCT category_id
function new_users($start, $end)
{
$query = '
SELECT id
FROM '.USERS_TABLE.'
SELECT user_id
FROM '.USER_INFOS_TABLE.'
WHERE registration_date > \''.$start.'\'
AND registration_date <= \''.$end.'\'
;';
return array_from_query($query, 'id');
return array_from_query($query, 'user_id');
}
/**
@@ -268,15 +268,17 @@ if (isset($_GET['feed'])
and preg_match('/^[A-Za-z0-9]{50}$/', $_GET['feed']))
{
$query = '
SELECT id, status, last_feed_check
FROM '.USERS_TABLE.'
SELECT user_id AS id,
status,
last_feed_check
FROM '.USER_INFOS_TABLE.'
WHERE feed_id = \''.$_GET['feed'].'\'
;';
$user = mysql_fetch_array(pwg_query($query));
}
else
{
$user = array('id' => ANONYMOUS,
$user = array('id' => $conf['guest_id'],
'status' => 'guest');
}
@@ -300,7 +302,7 @@ $rss->link = 'http://phpwebgallery.net';
// | Feed creation |
// +-----------------------------------------------------------------------+
if (ANONYMOUS != $user['id'])
if ($conf['guest_id'] != $user['id'])
{
$news = news($user['last_feed_check'], $dbnow);
@@ -330,9 +332,9 @@ if (ANONYMOUS != $user['id'])
}
$query = '
UPDATE '.USERS_TABLE.'
UPDATE '.USER_INFOS_TABLE.'
SET last_feed_check = \''.$dbnow.'\'
WHERE id = '.$user['id'].'
WHERE user_id = '.$user['id'].'
;';
pwg_query($query);
}