Add more checks for admin user
This commit is contained in:
parent
f4782a7690
commit
9a5d517ec2
5 changed files with 6 additions and 8 deletions
|
@ -20,6 +20,7 @@
|
|||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
OC_Util::checkAdminUser();
|
||||
OC_Util::checkAppEnabled('admin_export');
|
||||
if (isset($_POST['admin_export'])) {
|
||||
$root = OC::$SERVERROOT . "/";
|
||||
|
|
|
@ -22,19 +22,13 @@
|
|||
|
||||
// Init owncloud
|
||||
require_once('../../lib/base.php');
|
||||
OC_Util::checkLoggedIn();
|
||||
OC_Util::checkAppEnabled('contacts');
|
||||
|
||||
$id = $_GET['id'];
|
||||
|
||||
$l10n = new OC_L10N('contacts');
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn()){
|
||||
echo $l10n->t('You need to log in.');
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
$card = OC_Contacts_VCard::find( $id );
|
||||
if( $card === false ){
|
||||
echo $l10n->t('Contact could not be found.');
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
// Init owncloud
|
||||
require_once('../../lib/base.php');
|
||||
OC_JSON::checkAdminUser();
|
||||
OC_JSON::setContentTypeHeader();
|
||||
|
||||
OC_App::disable($_POST['appid']);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
// Init owncloud
|
||||
require_once('../../lib/base.php');
|
||||
OC_JSON::checkAdminUser();
|
||||
OC_JSON::setContentTypeHeader();
|
||||
|
||||
OC_App::enable($_POST['appid']);
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
*/
|
||||
$RUNTIME_NOSETUPFS=true;
|
||||
require_once('../lib/base.php');
|
||||
OC_Util::checkAdminUser();
|
||||
|
||||
$testCases=loadFiles(__DIR__,array('index.php','templates'));
|
||||
ob_end_clean();
|
||||
|
@ -74,4 +75,4 @@ function loadFiles($path,$exclude=false){
|
|||
}
|
||||
return $results;
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue