} } } else { die("No uploaded files recieved. Fatal error."); } if ($_GET['uploadstatuspage'] == 1) { $uploadrows = select_bhdb("uploads", array("sessionid" => session_id()), 1); if (empty($uploadrows) || $uploadrows[0]['status'] == "uploading") { $layoutobj = new bhlayout("popup_upload"); $layoutobj->display(); } elseif ($uploadrows[0]['status'] = "finished") { # Echo window closing script $str = "<html>\n<head>\n</head>\n<body>\n<script>self.close();</script>\n</body>\n</html>"; echo $str; # Remove entry in DB delete_bhdb("uploads", array("sessionid" => session_id())); } else { bh_log("Fatal error in upload notification system", "BH_ERROR"); } } elseif (count($fupload) > 0) { # Notify the popup to close $uploadrows = select_bhdb("uploads", array("sessionid" => session_id()), 1); if (empty($uploadrows)) { insert_bhdb("uploads", array("sessionid" => session_id(), "status" => "finished")); } else { update_bhdb("uploads", array("status" => "finished"), array("sessionid" => session_id())); } # Calculate used bandwidth foreach ($fupload as $fileinfo) { bh_bandwidth($bhsession['username'], "up", $fileinfo['size']); }
# Email the user $emailobj = new bhemail($regrows[0]['email']); $emailobj->subject = str_replace("#SITENAME#", $bhconfig['sitename'], $bhlang['emailsubject:registration_accepted']); $emailobj->message = str_replace("#USERNAME#", $regrows[0]['username'], $bhlang['email:registration_accepted']); $emailaway = $emailobj->send(); # All done. Say so. bh_log(str_replace("#USER#", $_GET['username'], $bhlang['notice:#USER#_accepted']), "BH_NOTICE"); } } if ($_GET['action'] == "reject") { $regrows = select_bhdb("registrations", array("regid" => $_GET['regid'], "username" => $_GET['username']), ""); if (empty($regrows)) { log_bh($bhlang['error:registration_doesnt_exist'], "BH_ERROR"); } else { # Delete the reg row delete_bhdb("registrations", array("regid" => $_GET['regid'], "username" => $_GET['username'])); # Email the user $emailobj = new bhemail($regrows[0]['email']); $emailobj->subject = str_replace("#SITENAME#", $bhconfig['sitename'], $bhlang['emailsubject:registration_rejected']); $emailobj->message = str_replace("#USERNAME#", $regrows[0]['username'], $bhlang['email:registration_rejected']); $emailaway = $emailobj->send(); # All done. Say so. bh_log(str_replace("#USER#", $_GET['username'], $bhlang['notice:#USER#_rejected']), "BH_NOTICE"); } } } if ($bhconfig['signupmoderation'] == 0) { $layout = new bhadminlayout("generic"); $layout->content1 = $bhlang['notice:registration_moderation_off']; $layout->title = $bhlang['title:registrations_administration']; $layout->display();
function bh_filelink_remove($filecode) { delete_bhdb("filecodes", array("filecode" => $filecode), ""); }
function set_grouprights($group, $status, $recursion = 1) { if ($this->is_dir() && $recursion == 1) { $this->loadfile(); foreach ($this->filecontents as $file2set) { $file2setobj = new bhfile($file2set['filepath']); $file2setobj->set_grouprights($group, $status); } } if ($status >= 0) { $grouprows = select_bhdb("aclgroups", array("group" => $group, "filepath" => $this->filepath), ""); if (!empty($grouprows)) { update_bhdb("aclgroups", array("status" => $status), array("group" => $group, "filepath" => $this->filepath)); } else { insert_bhdb("aclgroups", array("group" => $group, "filepath" => $this->filepath, "status" => $status)); } } else { delete_bhdb("aclgroups", array("group" => $group, "filepath" => $this->filepath)); } }
} if (empty($_GET['group'])) { $_GET['group'] = array(); } $group = array_merge($_POST['group'], $_GET['group']); if ($group['action'] == "add") { $grouprows = select_bhdb("groupusers", array("username" => $group['username'], "group" => $group['group']), ""); if (empty($grouprows)) { $userrows = select_bhdb("users", array("username" => $group['username']), ""); if (empty($userrows)) { bh_add_logvars(array("username" => $group['username'], "group" => $group['group'])); bh_add_error($bhlang['error:user_does_not_exist']); } else { insert_bhdb("groupusers", array("username" => $group['username'], "group" => $group['group'])); bh_add_logvars(array("username" => $group['username'], "group" => $group['group'])); bh_add_notice($bhlang['notice:user_added_to_group']); } } else { bh_add_logvars(array("username" => $group['username'], "group" => $group['group'])); bh_add_error($bhlang['error:user_is_in_group']); } } if ($group['action'] == "remove") { delete_bhdb("groupusers", array("username" => $group['username'], "group" => $group['group'])); bh_add_logvars(array("username" => $group['username'], "group" => $group['group'])); bh_add_notice($bhlang['notice:user_removed_from_group']); } $usersbygroup = bh_usersbygroup(); $layout->content1 = $usersbygroup; $layout->title = $bhlang['title:group_administration']; $layout->display();
function removedb() { delete_bhdb("aclusers", array("filepath" => $this->filepath)); delete_bhdb("aclgroups", array("filepath" => $this->filepath)); delete_bhdb("aclpublic", array("filepath" => $this->filepath)); delete_bhdb("metadata", array("filepath" => $this->filepath)); delete_bhdb("filecodes", array("filepath" => $this->filepath)); }
*/ #name Delete User #author Andrew Godwin #description Deletes a user, #iscore 1 $deleteusername = $_GET['username']; if ($_POST['dodelete'] == 1) { # Delete the user delete_bhdb("users", array("username" => $deleteusername)); # Say so bh_log($bhlang['notice:user_deleted'], "BH_NOTICE"); # Show user list require "modules/users.inc.php"; } elseif ($_POST['dodelete'] == 2) { # Delete the user delete_bhdb("users", array("username" => $deleteusername)); # Get their files $userfiles = bh_user_files($deleteusername); # Delete zem. foreach ($userfiles as $userfile) { $userfileobj = new bhfile($userfile); $userfileobj->deletefile(); unset($userfileobj); } # Say so bh_log($bhlang['notice:user_and_files_deleted'], "BH_NOTICE"); # Show user list require "modules/users.inc.php"; } else { $layout = new bhadminlayout("deleteuserform"); $layout->content1 = $deleteusername;
insert_bhdb("logactions", array("type" => "BH_SIGNUP_VALIDATED", "action" => "logtofile")); insert_bhdb("logactions", array("type" => "BH_SIGNUP_M_PENDING", "action" => "emailtype", "parameters" => "admin")); insert_bhdb("modulesaccesslevel", array("module" => "deletefolder", "accesslevel" => "2", "status" => "1")); insert_bhdb("modulesaccesslevel", array("module" => "deletefolder", "accesslevel" => "3", "status" => "1")); insert_bhdb("modulesaccesslevel", array("module" => "copyfolder", "accesslevel" => "1", "status" => "1")); insert_bhdb("modulesaccesslevel", array("module" => "copyfolder", "accesslevel" => "2", "status" => "1")); insert_bhdb("modulesaccesslevel", array("module" => "copyfolder", "accesslevel" => "3", "status" => "1")); insert_bhdb("modulesaccesslevel", array("module" => "sharing", "accesslevel" => "3", "status" => "1")); insert_bhdb("modulesaccesslevel", array("module" => "sharingfolder", "accesslevel" => "3", "status" => "1")); insert_bhdb("modulesaccesslevel", array("module" => "returntofolder", "accesslevel" => "1", "status" => "1")); insert_bhdb("modulesaccesslevel", array("module" => "returntofolder", "accesslevel" => "2", "status" => "1")); insert_bhdb("modulesaccesslevel", array("module" => "returntofolder", "accesslevel" => "3", "status" => "1")); insert_bhdb("modulesfiletype", array("module" => "sharing", "filetype" => "*", "status" => "1")); insert_bhdb("modulesfiletype", array("module" => "editdesc", "filetype" => "*", "status" => "1")); insert_bhdb("modulesfiletype", array("module" => "returntofolder", "filetype" => "*", "status" => "1")); delete_bhdb("modulesfiletype", array("module" => "move", "filetype" => "*", "status" => "1")); insert_bhdb("modulesdirectory", array("module" => "deletefolder", "status" => "1")); insert_bhdb("modulesdirectory", array("module" => "copyfolder", "status" => "1")); insert_bhdb("modulesdirectory", array("module" => "sharingfolder", "status" => "1")); insert_bhdb("adminmodulesmenu", array("module" => "registrations", "menu" => "page", "status" => "1", "menuorder" => "4")); insert_bhdb("adminmodulesmenu", array("module" => "appearance", "menu" => "page", "status" => "1", "menuorder" => "5")); insert_bhdb("modulesmenu", array("module" => "passreset", "menu" => "page", "status" => "1", "menuorder" => "8")); insert_bhdb("modulesmenu", array("module" => "options", "menu" => "page", "status" => "1", "menuorder" => "50")); insert_bhdb("modulesusertype", array("module" => "passreset", "usertype" => "guest", "status" => "1")); insert_bhdb("modulesusertype", array("module" => "options", "usertype" => "*", "status" => "1")); insert_bhdb("modulesusertype", array("module" => "options", "usertype" => "-guest", "status" => "1")); insert_bhdb("modulesusertype", array("module" => "deletefolder", "usertype" => "*", "status" => "1")); insert_bhdb("modulesusertype", array("module" => "copyfolder", "usertype" => "*", "status" => "1")); insert_bhdb("modulesusertype", array("module" => "sharingfolder", "usertype" => "*", "status" => "1")); insert_bhdb("modulesusertype", array("module" => "returntofolder", "usertype" => "*", "status" => "1")); insert_bhdb("aclpublic", array("filepath" => "/", "status" => "1"));