[Openupload-svn-update] SF.net SVN: openupload:[172] trunk/lib/modules/default/admin.inc.php
Status: Beta
Brought to you by:
tsdogs
|
From: <ts...@us...> - 2008-12-09 17:07:04
|
Revision: 172
http://openupload.svn.sourceforge.net/openupload/?rev=172&view=rev
Author: tsdogs
Date: 2008-12-09 17:07:00 +0000 (Tue, 09 Dec 2008)
Log Message:
-----------
Add delete confirmation and multi delete options to admin
Modified Paths:
--------------
trunk/lib/modules/default/admin.inc.php
Modified: trunk/lib/modules/default/admin.inc.php
===================================================================
--- trunk/lib/modules/default/admin.inc.php 2008-12-09 17:06:42 UTC (rev 171)
+++ trunk/lib/modules/default/admin.inc.php 2008-12-09 17:07:00 UTC (rev 172)
@@ -17,6 +17,7 @@
2 => "pluginadd",
3 => "pluginedit",
4 => "plugindel",
+ 5 => "pluginmultidel",
),
"adminpluginsoptions" => array (
1 => "pluginoptions",
@@ -29,6 +30,7 @@
1 => "files",
2 => "filedel",
3 => "filesplugin",
+ 4 => "filemultidel",
),
"adminusers" => array (
1 => "users",
@@ -36,12 +38,14 @@
3 => "useredit",
4 => "userdel",
5 => "useractivate",
+ 6 => "usermultidel",
),
"admingroups" => array (
1 => "groups",
2 => "groupadd",
3 => "groupedit",
4 => "groupdel",
+ 5 => "groupmultidel",
),
"adminrights" => array (
1 => "rights",
@@ -52,6 +56,7 @@
2 => "bannedadd",
3 => "bannededit",
4 => "banneddel",
+ 5 => "bannedmultidel",
),
"adminlangs" => array (
1 => "langs",
@@ -59,6 +64,7 @@
3 => "langedit",
4 => "langdel",
5 => "langtoggle",
+ 6 => "langmultidel",
),
"adminlogs" => array (
1 => "logs",
@@ -147,6 +153,18 @@
$this->nextStep(1);
}
+ function usermultidel() {
+ global $_POST;
+
+ foreach ($_POST as $k => $v) {
+ if (($v == 1) and (strpos($k,'user_'))!==FALSE) {
+ $user = substr($k,5,strlen($k)-5);
+ app()->auth->userdel($user);
+ }
+ }
+ $this->nextStep(1);
+ }
+
function useractivate() {
global $_GET;
@@ -264,6 +282,21 @@
$this->nextStep(1);
}
+ function groupmultidel() {
+ global $_POST;
+
+ foreach ($_POST as $k => $v) {
+ if (($v == 1) and (strpos($k,'group_'))!==FALSE) {
+ $group = substr($k,6,strlen($k)-6);
+ app()->auth->groupdel($group);
+ /* delete all the rights of the group */
+ app()->db->delete('acl',array('group_name' => $group));
+ app()->db->delete('plugin_acl',array('group_name' => $group));
+ }
+ }
+ $this->nextStep(1);
+ }
+
function rights() {
$groups = app()->auth->groupinfo();
array_unshift($groups,array('name' => '*','description' => tr('Any group')));
@@ -388,12 +421,30 @@
$f = app()->db->read('files',array('id'=>$_GET['id']));
if ($f[0]['id']==$_GET['id']) {
app()->db->delete('files',array('id' => $_GET['id']));
+ app()->db->delete('file_options',array('file_id' => $_GET['id']));
unlink(app()->config['DATA_PATH'].'/'.$_GET['id']);
}
}
$this->nextStep(1);
}
+ function filemultidel() {
+ global $_POST;
+
+ foreach ($_POST as $k => $v) {
+ if (($v == 1) and (strpos($k,'file_'))!==FALSE) {
+ $fid = substr($k,5,strlen($k)-5);
+ $f = app()->db->read('files',array('id'=>$fid));
+ if ($f[0]['id']==$fid) {
+ app()->db->delete('files',array('id' => $fid));
+ app()->db->delete('file_options',array('file_id' => $fid));
+ unlink(app()->config['DATA_PATH'].'/'.$fid);
+ }
+ }
+ }
+ $this->nextStep(1);
+ }
+
function filesplugin() {
global $_GET;
if (isset($_GET['plugin'])) {
@@ -467,6 +518,18 @@
$this->nextStep(1);
}
+ function pluginmultidel() {
+ global $_POST;
+
+ foreach ($_POST as $k => $v) {
+ if (($v == 1) and (strpos($k,'p_'))!==FALSE) {
+ $p = substr($k,2,strlen($k)-2);
+ app()->db->delete('plugin_acl',array('id' => $p));
+ }
+ }
+ $this->nextStep(1);
+ }
+
function pluginoptions() {
/* list the plugins */
foreach (app()->config['plugins'] as $p) {
@@ -724,6 +787,19 @@
$this->nextStep(1);
}
+ function bannedmultidel() {
+ global $_POST;
+
+ foreach ($_POST as $k => $v) {
+ if (($v == 1) and (strpos($k,'ban_'))!==FALSE) {
+ $ban = substr($k,4,strlen($k)-4);
+ /* delete all the rights of the group */
+ app()->db->delete('banned',array('id' => $ban));
+ }
+ }
+ $this->nextStep(1);
+ }
+
function bannedup() {
}
function banneddown() {
@@ -805,6 +881,18 @@
$this->nextStep(1);
}
+ function langmultidel() {
+ global $_POST;
+
+ foreach ($_POST as $k => $v) {
+ if (($v == 1) and (strpos($k,'lang_'))!==FALSE) {
+ $lang = substr($k,5,strlen($k)-5);
+ app()->db->delete('langs',array('id' => $lang));
+ }
+ }
+ $this->nextStep(1);
+ }
+
function langtoggle() {
global $_GET;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|