|
|
@ -24,7 +24,7 @@ class OC_JSON{ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static function checkAppEnabled($app){ |
|
|
|
public static function checkAppEnabled($app){ |
|
|
|
if( !OC_App::isEnabled($app)){ |
|
|
|
if( !OC_App::isEnabled($app)){ |
|
|
|
$l = OC_L10N::get('core'); |
|
|
|
$l = OC_L10N::get('lib'); |
|
|
|
self::error(array( 'data' => array( 'message' => $l->t('Application is not enabled') ))); |
|
|
|
self::error(array( 'data' => array( 'message' => $l->t('Application is not enabled') ))); |
|
|
|
exit(); |
|
|
|
exit(); |
|
|
|
} |
|
|
|
} |
|
|
@ -35,7 +35,7 @@ class OC_JSON{ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static function checkLoggedIn(){ |
|
|
|
public static function checkLoggedIn(){ |
|
|
|
if( !OC_User::isLoggedIn()){ |
|
|
|
if( !OC_User::isLoggedIn()){ |
|
|
|
$l = OC_L10N::get('core'); |
|
|
|
$l = OC_L10N::get('lib'); |
|
|
|
self::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); |
|
|
|
self::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); |
|
|
|
exit(); |
|
|
|
exit(); |
|
|
|
} |
|
|
|
} |
|
|
@ -47,7 +47,7 @@ class OC_JSON{ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static function callCheck(){ |
|
|
|
public static function callCheck(){ |
|
|
|
if( !OC_Util::isCallRegistered()){ |
|
|
|
if( !OC_Util::isCallRegistered()){ |
|
|
|
$l = OC_L10N::get('core'); |
|
|
|
$l = OC_L10N::get('lib'); |
|
|
|
self::error(array( 'data' => array( 'message' => $l->t('Token expired. Please reload page.') ))); |
|
|
|
self::error(array( 'data' => array( 'message' => $l->t('Token expired. Please reload page.') ))); |
|
|
|
exit(); |
|
|
|
exit(); |
|
|
|
} |
|
|
|
} |
|
|
@ -59,7 +59,7 @@ class OC_JSON{ |
|
|
|
public static function checkAdminUser(){ |
|
|
|
public static function checkAdminUser(){ |
|
|
|
self::checkLoggedIn(); |
|
|
|
self::checkLoggedIn(); |
|
|
|
if( !OC_Group::inGroup( OC_User::getUser(), 'admin' )){ |
|
|
|
if( !OC_Group::inGroup( OC_User::getUser(), 'admin' )){ |
|
|
|
$l = OC_L10N::get('core'); |
|
|
|
$l = OC_L10N::get('lib'); |
|
|
|
self::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); |
|
|
|
self::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); |
|
|
|
exit(); |
|
|
|
exit(); |
|
|
|
} |
|
|
|
} |
|
|
@ -71,7 +71,7 @@ class OC_JSON{ |
|
|
|
public static function checkSubAdminUser(){ |
|
|
|
public static function checkSubAdminUser(){ |
|
|
|
self::checkLoggedIn(); |
|
|
|
self::checkLoggedIn(); |
|
|
|
if(!OC_Group::inGroup(OC_User::getUser(),'admin') && !OC_SubAdmin::isSubAdmin(OC_User::getUser())){ |
|
|
|
if(!OC_Group::inGroup(OC_User::getUser(),'admin') && !OC_SubAdmin::isSubAdmin(OC_User::getUser())){ |
|
|
|
$l = OC_L10N::get('core'); |
|
|
|
$l = OC_L10N::get('lib'); |
|
|
|
self::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); |
|
|
|
self::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); |
|
|
|
exit(); |
|
|
|
exit(); |
|
|
|
} |
|
|
|
} |
|
|
|