]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add more checks for admin user
authorBart Visscher <bartv@thisnet.nl>
Fri, 30 Sep 2011 21:10:08 +0000 (23:10 +0200)
committerBart Visscher <bartv@thisnet.nl>
Fri, 30 Sep 2011 21:17:30 +0000 (23:17 +0200)
apps/admin_export/settings.php
apps/contacts/photo.php
settings/ajax/disableapp.php
settings/ajax/enableapp.php
tests/index.php

index 565c4b3db976036778cadecf7d95d9f642c3b9c8..8308a2b89b502af9789e1de397bf446da98f917c 100644 (file)
@@ -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 . "/";
index 1bdfbe3a27f0f2507b53c960685c2cd3da91562c..5178fe7a078d021e5f790fe0b263f945de11c028 100644 (file)
 
 // 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.');
index 12f6b32a4f396ac6ca734b7ec7434d56277d092c..06dd3c2ac6bfd5dc9fddc8959a10b8fd41c234b1 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 // Init owncloud
 require_once('../../lib/base.php');
+OC_JSON::checkAdminUser();
 OC_JSON::setContentTypeHeader();
 
 OC_App::disable($_POST['appid']);
index 8be80cd2ececdb91a2743df713b08c1c97cc6d33..639df2aecc0fad9505acdcdc12d1691d998b863a 100644 (file)
@@ -2,6 +2,7 @@
 
 // Init owncloud
 require_once('../../lib/base.php');
+OC_JSON::checkAdminUser();
 OC_JSON::setContentTypeHeader();
 
 OC_App::enable($_POST['appid']);
index efa730f6f8f88b35883a9e5e9c5473ed48a9a38c..08e53f1a5756591bf56b1da38b158a73372ee95f 100644 (file)
@@ -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;
 }
-?>
\ No newline at end of file
+?>