[Openupload-svn-update] SF.net SVN: openupload:[75] trunk/lib/modules/default
Status: Beta
Brought to you by:
tsdogs
|
From: <ts...@us...> - 2008-10-24 11:15:46
|
Revision: 75
http://openupload.svn.sourceforge.net/openupload/?rev=75&view=rev
Author: tsdogs
Date: 2008-10-24 09:19:12 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
if auth does not support user admin, disable registration / profile change
Modified Paths:
--------------
trunk/lib/modules/default/admin.inc.php
trunk/lib/modules/default/auth.inc.php
Modified: trunk/lib/modules/default/admin.inc.php
===================================================================
--- trunk/lib/modules/default/admin.inc.php 2008-10-24 09:13:19 UTC (rev 74)
+++ trunk/lib/modules/default/admin.inc.php 2008-10-24 09:19:12 UTC (rev 75)
@@ -140,7 +140,6 @@
if (isset($_GET['id'])) {
$active=$_GET['active']==1?0:1;
$user = app()->auth->userinfo($_GET['id']);
- $user = $user[0];
if ($user['login']==$_GET['id']) {
$user['active']=$active;
app()->auth->useredit($user,false);
Modified: trunk/lib/modules/default/auth.inc.php
===================================================================
--- trunk/lib/modules/default/auth.inc.php 2008-10-24 09:13:19 UTC (rev 74)
+++ trunk/lib/modules/default/auth.inc.php 2008-10-24 09:19:12 UTC (rev 75)
@@ -43,7 +43,8 @@
$this->menu['profile']=tr('Preferences');
$this->menu['logout']=tr('Logout');
}
- $this->tpl->assign('register',app()->checkACL(app()->user->group(),'auth','register')=='allow');
+ if (app()->auth->features['useradmin']=='yes')
+ $this->tpl->assign('register',app()->checkACL(app()->user->group(),'auth','register')=='allow');
}
@@ -87,6 +88,11 @@
global $_GET;
global $_POST;
+ if (app()->auth->features['useradmin']!='yes') {
+ app()->error(tr('Registration is not supported by Auth Module'));
+ redirect();
+ }
+
if (isset($_GET['regid'])) {
/* confirm registration */
$_SESSION['user']['regidconfirm']=$_GET['regid'];
@@ -104,6 +110,11 @@
function registerConfirm() {
global $_SESSION;
global $_POST;
+
+ if (app()->auth->features['useradmin']!='yes') {
+ app()->error(tr('Registration is not supported by Auth Module'));
+ redirect();
+ }
if (isset($_POST['registerlogin'])) {
/* check for the unique login */
@@ -184,6 +195,12 @@
function registerEnable() {
global $_SESSION;
+
+ if (app()->auth->features['useradmin']!='yes') {
+ app()->error(tr('Registration is not supported by Auth Module'));
+ redirect();
+ }
+
/* if everything is ok register the user */
if (isset($_SESSION['user']['regidconfirm'])) {
$user = app()->db->read('users',array('regid' => $_SESSION['user']['regidconfirm']));
@@ -197,12 +214,23 @@
}
function profile() {
+
+ if (app()->auth->features['useradmin']!='yes') {
+ app()->error(tr('User profile change not supported by Auth Module'));
+ redirect();
+ }
+
$user = app()->user->info();
$this->tpl->assign('puser',$user);
}
function profileedit() {
global $_POST;
+
+ if (app()->auth->features['useradmin']!='yes') {
+ app()->error(tr('User profile change not supported by Auth Module'));
+ redirect();
+ }
$user = app()->user->info();
if (isset($_POST['username'])) {
/* check for valid values*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|