aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]apps/admin_migrate/settings.php2
-rwxr-xr-x[-rw-r--r--]apps/bookmarks/addBm.php2
-rwxr-xr-xapps/bookmarks/index.php2
-rwxr-xr-x[-rw-r--r--]apps/calendar/export.php2
-rwxr-xr-xapps/calendar/index.php2
-rwxr-xr-x[-rw-r--r--]apps/contacts/export.php2
-rwxr-xr-xapps/contacts/index.php2
-rwxr-xr-xapps/contacts/photo.php2
-rwxr-xr-xapps/contacts/thumbnail.php2
-rwxr-xr-x[-rw-r--r--]apps/external/ajax/setsites.php2
-rwxr-xr-x[-rw-r--r--]apps/external/index.php2
-rwxr-xr-xapps/external/settings.php2
-rwxr-xr-x[-rw-r--r--]apps/files/admin.php2
-rwxr-xr-x[-rw-r--r--]apps/files/ajax/download.php2
-rwxr-xr-x[-rw-r--r--]apps/files/download.php2
-rwxr-xr-xapps/files/index.php2
-rwxr-xr-xapps/files/settings.php2
-rwxr-xr-xapps/files_sharing/list.php2
-rwxr-xr-xapps/files_sharing/settings.php2
-rwxr-xr-xapps/files_versions/history.php2
-rwxr-xr-xapps/files_versions/settings.php2
-rwxr-xr-xapps/gallery/index.php2
-rwxr-xr-xapps/media/index.php2
-rwxr-xr-xapps/user_migrate/admin.php2
-rw-r--r--lib/public/user.php15
-rw-r--r--lib/public/util.php9
26 files changed, 48 insertions, 24 deletions
diff --git a/apps/admin_migrate/settings.php b/apps/admin_migrate/settings.php
index 94bf6052a6b..da96e1a8684 100644..100755
--- a/apps/admin_migrate/settings.php
+++ b/apps/admin_migrate/settings.php
@@ -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?
diff --git a/apps/bookmarks/addBm.php b/apps/bookmarks/addBm.php
index 27e01bb3baf..afe61875737 100644..100755
--- a/apps/bookmarks/addBm.php
+++ b/apps/bookmarks/addBm.php
@@ -24,7 +24,7 @@
// Check if we are a user
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
OC_Util::checkAppEnabled('bookmarks');
require_once('bookmarksHelper.php');
diff --git a/apps/bookmarks/index.php b/apps/bookmarks/index.php
index 575c14c114c..7ab74c5f3f3 100755
--- a/apps/bookmarks/index.php
+++ b/apps/bookmarks/index.php
@@ -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' );
diff --git a/apps/calendar/export.php b/apps/calendar/export.php
index 0972ee0f788..9b71bc6910f 100644..100755
--- a/apps/calendar/export.php
+++ b/apps/calendar/export.php
@@ -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;
diff --git a/apps/calendar/index.php b/apps/calendar/index.php
index cc6b19a0402..77550420b53 100755
--- a/apps/calendar/index.php
+++ b/apps/calendar/index.php
@@ -7,7 +7,7 @@
*/
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
OC_Util::checkAppEnabled('calendar');
// Create default calendar ...
diff --git a/apps/contacts/export.php b/apps/contacts/export.php
index 95d02a9afd4..84bf26042fb 100644..100755
--- a/apps/contacts/export.php
+++ b/apps/contacts/export.php
@@ -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;
diff --git a/apps/contacts/index.php b/apps/contacts/index.php
index a680da3fa97..8f2a561b312 100755
--- a/apps/contacts/index.php
+++ b/apps/contacts/index.php
@@ -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.
diff --git a/apps/contacts/photo.php b/apps/contacts/photo.php
index f9e62455c13..12d7f370710 100755
--- a/apps/contacts/photo.php
+++ b/apps/contacts/photo.php
@@ -10,7 +10,7 @@
// Init owncloud
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
OC_Util::checkAppEnabled('contacts');
function getStandardImage(){
diff --git a/apps/contacts/thumbnail.php b/apps/contacts/thumbnail.php
index 1f9fbd7135e..ab5d160135e 100755
--- a/apps/contacts/thumbnail.php
+++ b/apps/contacts/thumbnail.php
@@ -23,7 +23,7 @@
// Init owncloud
OC_JSON::checkLoggedIn();
-//OC_Util::checkLoggedIn();
+//OCP\User::checkLoggedIn();
OC_Util::checkAppEnabled('contacts');
function getStandardImage(){
diff --git a/apps/external/ajax/setsites.php b/apps/external/ajax/setsites.php
index 3223bf68d9b..5f36b3d13d5 100644..100755
--- a/apps/external/ajax/setsites.php
+++ b/apps/external/ajax/setsites.php
@@ -7,7 +7,7 @@
*/
-OC_Util::checkAdminUser();
+OCP\User::checkAdminUser();
$sites = array();
for ($i = 0; $i < sizeof($_POST['site_name']); $i++) {
diff --git a/apps/external/index.php b/apps/external/index.php
index 0baa62a94b6..1d4e5cc5051 100644..100755
--- a/apps/external/index.php
+++ b/apps/external/index.php
@@ -23,7 +23,7 @@
require_once('lib/external.php');
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
if (isset($_GET['id'])) {
diff --git a/apps/external/settings.php b/apps/external/settings.php
index a0c4bb0523d..c1a4242c333 100755
--- a/apps/external/settings.php
+++ b/apps/external/settings.php
@@ -1,6 +1,6 @@
<?php
-OC_Util::checkAdminUser();
+OCP\User::checkAdminUser();
OCP\Util::addscript( "external", "admin" );
diff --git a/apps/files/admin.php b/apps/files/admin.php
index bdea70506fb..ae7ea0436a0 100644..100755
--- a/apps/files/admin.php
+++ b/apps/files/admin.php
@@ -25,7 +25,7 @@
// Init owncloud
-OC_Util::checkAdminUser();
+OCP\User::checkAdminUser();
$htaccessWorking=(getenv('htaccessWorking')=='true');
diff --git a/apps/files/ajax/download.php b/apps/files/ajax/download.php
index 65c04c36faf..fd2d9b891f5 100644..100755
--- a/apps/files/ajax/download.php
+++ b/apps/files/ajax/download.php
@@ -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"];
diff --git a/apps/files/download.php b/apps/files/download.php
index ec4a6e1fc9c..a4077b9f042 100644..100755
--- a/apps/files/download.php
+++ b/apps/files/download.php
@@ -25,7 +25,7 @@
// Check if we are a user
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
$filename = $_GET["file"];
diff --git a/apps/files/index.php b/apps/files/index.php
index 180452593ab..2d3b0a13b25 100755
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -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" );
diff --git a/apps/files/settings.php b/apps/files/settings.php
index 46d557b43ca..cfadc54573d 100755
--- a/apps/files/settings.php
+++ b/apps/files/settings.php
@@ -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" );
diff --git a/apps/files_sharing/list.php b/apps/files_sharing/list.php
index 9a8a36219ae..e607348a037 100755
--- a/apps/files_sharing/list.php
+++ b/apps/files_sharing/list.php
@@ -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");
diff --git a/apps/files_sharing/settings.php b/apps/files_sharing/settings.php
index da38b88d79e..26c8df682bb 100755
--- a/apps/files_sharing/settings.php
+++ b/apps/files_sharing/settings.php
@@ -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'));
diff --git a/apps/files_versions/history.php b/apps/files_versions/history.php
index d806638e011..eb8886239d3 100755
--- a/apps/files_versions/history.php
+++ b/apps/files_versions/history.php
@@ -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' );
diff --git a/apps/files_versions/settings.php b/apps/files_versions/settings.php
index c6312b7be7b..59609de15b4 100755
--- a/apps/files_versions/settings.php
+++ b/apps/files_versions/settings.php
@@ -1,6 +1,6 @@
<?php
-OC_Util::checkAdminUser();
+OCP\User::checkAdminUser();
OCP\Util::addscript( 'files_versions', 'versions' );
diff --git a/apps/gallery/index.php b/apps/gallery/index.php
index cc6faa1406b..1d7fc1aee74 100755
--- a/apps/gallery/index.php
+++ b/apps/gallery/index.php
@@ -23,7 +23,7 @@
-OC_Util::checkLoggedIn();
+OCP\User::checkLoggedIn();
OC_Util::checkAppEnabled('gallery');
OC_App::setActiveNavigationEntry( 'gallery_index' );
diff --git a/apps/media/index.php b/apps/media/index.php
index ee0681668a5..0d226cb0ca1 100755
--- a/apps/media/index.php
+++ b/apps/media/index.php
@@ -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');
diff --git a/apps/user_migrate/admin.php b/apps/user_migrate/admin.php
index e94bda5baec..028433939c5 100755
--- a/apps/user_migrate/admin.php
+++ b/apps/user_migrate/admin.php
@@ -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?
diff --git a/lib/public/user.php b/lib/public/user.php
index febac06730f..b39235bb965 100644
--- a/lib/public/user.php
+++ b/lib/public/user.php
@@ -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();
+ }
+
}
diff --git a/lib/public/util.php b/lib/public/util.php
index c4a73a5a7fc..5cfcbaeeffc 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -122,6 +122,15 @@ class Util {
+
+
+
+
+
+
+
+
+
}
?>