]> source.dussan.org Git - nextcloud-server.git/commitdiff
ported checkLoggedIn and checkAdmin
authorFrank Karlitschek <frank@owncloud.org>
Tue, 1 May 2012 20:59:38 +0000 (22:59 +0200)
committerFrank Karlitschek <frank@owncloud.org>
Tue, 1 May 2012 20:59:38 +0000 (22:59 +0200)
26 files changed:
apps/admin_migrate/settings.php [changed mode: 0644->0755]
apps/bookmarks/addBm.php [changed mode: 0644->0755]
apps/bookmarks/index.php
apps/calendar/export.php [changed mode: 0644->0755]
apps/calendar/index.php
apps/contacts/export.php [changed mode: 0644->0755]
apps/contacts/index.php
apps/contacts/photo.php
apps/contacts/thumbnail.php
apps/external/ajax/setsites.php [changed mode: 0644->0755]
apps/external/index.php [changed mode: 0644->0755]
apps/external/settings.php
apps/files/admin.php [changed mode: 0644->0755]
apps/files/ajax/download.php [changed mode: 0644->0755]
apps/files/download.php [changed mode: 0644->0755]
apps/files/index.php
apps/files/settings.php
apps/files_sharing/list.php
apps/files_sharing/settings.php
apps/files_versions/history.php
apps/files_versions/settings.php
apps/gallery/index.php
apps/media/index.php
apps/user_migrate/admin.php
lib/public/user.php
lib/public/util.php

old mode 100644 (file)
new mode 100755 (executable)
index 94bf605..da96e1a
@@ -22,7 +22,7 @@
  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-OC_Util::checkAdminUser();
+OCP\User::checkAdminUser();
 OC_Util::checkAppEnabled('admin_migrate');
 
 // Export?
old mode 100644 (file)
new mode 100755 (executable)
index 27e01bb..afe6187
@@ -24,7 +24,7 @@
 
 
 // Check if we are a user
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
 OC_Util::checkAppEnabled('bookmarks');
 
 require_once('bookmarksHelper.php');
index 575c14c114c1b869ca9513a2d7c893f5073074a5..7ab74c5f3f31427e48f103ea6b03e02fa3a0bfab 100755 (executable)
@@ -24,7 +24,7 @@
 
 
 // Check if we are a user
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
 OC_Util::checkAppEnabled('bookmarks');
 
 OC_App::setActiveNavigationEntry( 'bookmarks_index' );
old mode 100644 (file)
new mode 100755 (executable)
index 0972ee0..9b71bc6
@@ -7,7 +7,7 @@
  */
 
  
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
 OC_Util::checkAppEnabled('calendar');
 $cal = isset($_GET['calid']) ? $_GET['calid'] : NULL;
 $event = isset($_GET['eventid']) ? $_GET['eventid'] : NULL;
index cc6b19a0402163b839699318803a4fd1b598347f..77550420b53bada896f35d6bfa845bffab529bb8 100755 (executable)
@@ -7,7 +7,7 @@
  */
 
  
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
 OC_Util::checkAppEnabled('calendar');
 
 // Create default calendar ...
old mode 100644 (file)
new mode 100755 (executable)
index 95d02a9..84bf260
@@ -7,7 +7,7 @@
  */
 
  
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
 OC_Util::checkAppEnabled('contacts');
 $bookid = isset($_GET['bookid']) ? $_GET['bookid'] : NULL;
 $contactid = isset($_GET['contactid']) ? $_GET['contactid'] : NULL;
index a680da3fa9766bd8935970f3ae3e7c7f3f34ecc6..8f2a561b312a9051109ec5e2bc8ffb936808bf62 100755 (executable)
@@ -9,7 +9,7 @@
 
 
 // Check if we are a user
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
 OC_Util::checkAppEnabled('contacts');
 
 // Get active address books. This creates a default one if none exists.
index f9e62455c13040fafcec0019603bea5ee806b667..12d7f370710f6c36bb6d8e6ca9bc99dfa63472e8 100755 (executable)
@@ -10,7 +10,7 @@
 
 // Init owncloud
 
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
 OC_Util::checkAppEnabled('contacts');
 
 function getStandardImage(){
index 1f9fbd7135e4c2361ceaf11e463df493d98445c4..ab5d160135e0def5f0b6e478ea8723cad80a9235 100755 (executable)
@@ -23,7 +23,7 @@
 // Init owncloud
 
 OC_JSON::checkLoggedIn();
-//OC_Util::checkLoggedIn();
+//OCP\User::checkLoggedIn();
 OC_Util::checkAppEnabled('contacts');
 
 function getStandardImage(){
old mode 100644 (file)
new mode 100755 (executable)
index 3223bf6..5f36b3d
@@ -7,7 +7,7 @@
  */
 
  
-OC_Util::checkAdminUser();
+OCP\User::checkAdminUser();
 
 $sites = array();
 for ($i = 0; $i < sizeof($_POST['site_name']); $i++) {
old mode 100644 (file)
new mode 100755 (executable)
index 0baa62a..1d4e5cc
@@ -23,7 +23,7 @@
 
 require_once('lib/external.php');
 
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
 
 if (isset($_GET['id'])) {
 
index a0c4bb0523d8c819352ebbd7b2cc8373942c2c44..c1a4242c3336dbff1f147408a1346d7b0b99f06c 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
 
-OC_Util::checkAdminUser();
+OCP\User::checkAdminUser();
 
 OCP\Util::addscript( "external", "admin" );
 
old mode 100644 (file)
new mode 100755 (executable)
index bdea705..ae7ea04
@@ -25,7 +25,7 @@
 // Init owncloud
  
 
-OC_Util::checkAdminUser();
+OCP\User::checkAdminUser();
 
 $htaccessWorking=(getenv('htaccessWorking')=='true');
 
old mode 100644 (file)
new mode 100755 (executable)
index 65c04c3..fd2d9b8
@@ -28,7 +28,7 @@ $RUNTIME_APPTYPES=array('filesystem');
 
 
 // Check if we are a user
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
 
 $files = $_GET["files"];
 $dir = $_GET["dir"];
old mode 100644 (file)
new mode 100755 (executable)
index ec4a6e1..a4077b9
@@ -25,7 +25,7 @@
  
 
 // Check if we are a user
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
 
 $filename = $_GET["file"];
 
index 180452593ab9a541d8595ef8519d8bc64fd8e922..2d3b0a13b2505b1c67364deb88959097210c8b47 100755 (executable)
@@ -22,7 +22,7 @@
 */
 
 // Check if we are a user
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
 
 // Load the files we need
 OCP\Util::addStyle( "files", "files" );
index 46d557b43ca3411254110f45aff5343894348cb6..cfadc54573da05e68d062926418add71fe531d32 100755 (executable)
@@ -26,7 +26,7 @@
  
 
 // Check if we are a user
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
 
 // Load the files we need
 OCP\Util::addStyle( "files", "files" );
index 9a8a36219ae3b50bcd5b0f1e67284a8326c728e6..e607348a037b9c374192ad5023fa05575e0713eb 100755 (executable)
@@ -23,7 +23,7 @@
 
 require_once('lib_share.php');
 
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
 OC_Util::checkAppEnabled('files_sharing');
 
 OC_App::setActiveNavigationEntry("files_sharing_list");
index da38b88d79e28f65420ad7881d7a6f1b6cf21e3c..26c8df682bbb3cda1ea599ac62231890f80a5fcd 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
 
-OC_Util::checkAdminUser();
+OCP\User::checkAdminUser();
 OCP\Util::addscript('files_sharing', 'settings');
 $tmpl = new OC_Template('files_sharing', 'settings');
 $tmpl->assign('allowResharing', OC_Appconfig::getValue('files_sharing', 'resharing', 'yes'));
index d806638e01172ad8770a1ff0c3659b44fdde3ffc..eb8886239d31717f0365ac138ee4224f7422d37a 100755 (executable)
@@ -22,7 +22,7 @@
  */
 require_once( '../../lib/base.php' );
 
-OC_Util::checkLoggedIn( );
+OCP\User::checkLoggedIn( );
 OCP\Util::addStyle('files_versions','versions');
 $tmpl = new OC_Template( 'files_versions', 'history', 'user' );
 
index c6312b7be7ba45e0259eb0640227b61c9dba2650..59609de15b4e8c3e37542326c0ea40c95cae9510 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
 
-OC_Util::checkAdminUser();
+OCP\User::checkAdminUser();
 
 OCP\Util::addscript( 'files_versions', 'versions' );
 
index cc6faa1406b8c75d0afcab9afbc93907dd61b2b4..1d7fc1aee748847fd9e28229829d8d62016cc3bd 100755 (executable)
@@ -23,7 +23,7 @@
 
 
 
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
 OC_Util::checkAppEnabled('gallery');
 OC_App::setActiveNavigationEntry( 'gallery_index' );
 
index ee0681668a566ee7af6267f5e357c93f7ce1b120..0d226cb0ca15daf31edda33a650b158b7d1f7d0f 100755 (executable)
@@ -25,7 +25,7 @@
 
 
 // Check if we are a user
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
 OC_Util::checkAppEnabled('media');
 
 require_once(OC::$APPSROOT . '/apps/media/lib_collection.php');
index e94bda5baec4d41c974728107d03407991f4544b..028433939c59bcb5b949747ed59a99cfb93f0109 100755 (executable)
@@ -20,7 +20,7 @@
  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-OC_Util::checkAdminUser();
+OCP\User::checkAdminUser();
 OC_Util::checkAppEnabled('user_migrate');
 
 // Import?
index febac06730f4cdea5399ffd18f4c5ee26a01db32..b39235bb96507829cd256b01b0091282be769c6a 100644 (file)
@@ -84,6 +84,21 @@ class User {
                return \OC_USER::checkPassword($uid, $password);
        }
 
+        /**
+        * Check if the user is a admin, redirects to home if not
+        */
+        public static function checkAdminUser(){
+                \OC_Util::checkAdminUser();
+        }
+
+        /**
+        * Check if the user is logged in, redirects to home if not. With
+        * redirect URL parameter to the request URI.
+        */
+        public static function checkLoggedIn(){
+                \OC_Util::checkLoggedIn();
+        }
+
 
 }
 
index c4a73a5a7fc2d153629268141d093b6898108b8f..5cfcbaeeffc4e82039f63e6fa57c12c6adca20c8 100644 (file)
@@ -122,6 +122,15 @@ class Util {
 
 
 
+
+
+
+
+
+
+
+
+
 }
 
 ?>