Skip to content
Snippets Groups Projects
Commit 254b8b95 authored by Frank Karlitschek's avatar Frank Karlitschek
Browse files

porting of OC_User to public API complete.

What better thing to do during a long train ride than refactoring ;-)
parent 70cea18c
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ switch($sharetype){ ...@@ -28,7 +28,7 @@ switch($sharetype){
OC_JSON::error(array('message'=>'unexspected parameter')); OC_JSON::error(array('message'=>'unexspected parameter'));
exit; exit;
} }
if($sharetype == 'user' && !OC_User::userExists($sharewith)){ if($sharetype == 'user' && !OCP\User::userExists($sharewith)){
OC_JSON::error(array('message'=>'user not found')); OC_JSON::error(array('message'=>'user not found'));
exit; exit;
} }
......
...@@ -35,7 +35,7 @@ switch($sharetype){ ...@@ -35,7 +35,7 @@ switch($sharetype){
OC_JSON::error(array('message'=>'unexspected parameter')); OC_JSON::error(array('message'=>'unexspected parameter'));
exit; exit;
} }
if($sharetype == 'user' && !OC_User::userExists($sharewith)){ if($sharetype == 'user' && !OCP\User::userExists($sharewith)){
OC_JSON::error(array('message'=>'user not found')); OC_JSON::error(array('message'=>'user not found'));
exit; exit;
} }
......
...@@ -27,7 +27,7 @@ switch($sharetype){ ...@@ -27,7 +27,7 @@ switch($sharetype){
OC_JSON::error(array('message'=>'unexspected parameter')); OC_JSON::error(array('message'=>'unexspected parameter'));
exit; exit;
} }
if($sharetype == 'user' && !OC_User::userExists($sharewith)){ if($sharetype == 'user' && !OCP\User::userExists($sharewith)){
OC_JSON::error(array('message'=>'user not found')); OC_JSON::error(array('message'=>'user not found'));
exit; exit;
}elseif($sharetype == 'group' && !OC_Group::groupExists($sharewith)){ }elseif($sharetype == 'group' && !OC_Group::groupExists($sharewith)){
......
...@@ -11,7 +11,7 @@ OC_Hook::connect('OC_User','post_login','OC_Crypt','loginListener'); ...@@ -11,7 +11,7 @@ OC_Hook::connect('OC_User','post_login','OC_Crypt','loginListener');
stream_wrapper_register('crypt','OC_CryptStream'); stream_wrapper_register('crypt','OC_CryptStream');
if(!isset($_SESSION['enckey']) and OCP\User::isLoggedIn()){//force the user to re-loggin if the encryption key isn't unlocked (happens when a user is logged in before the encryption app is enabled) if(!isset($_SESSION['enckey']) and OCP\User::isLoggedIn()){//force the user to re-loggin if the encryption key isn't unlocked (happens when a user is logged in before the encryption app is enabled)
OC_User::logout(); OCP\User::logout();
header("Location: ".OC::$WEBROOT.'/'); header("Location: ".OC::$WEBROOT.'/');
exit(); exit();
} }
......
...@@ -51,7 +51,7 @@ class OC_Share { ...@@ -51,7 +51,7 @@ class OC_Share {
$uid_shared_with = OC_Group::usersInGroup($gid); $uid_shared_with = OC_Group::usersInGroup($gid);
// Remove the owner from the list of users in the group // Remove the owner from the list of users in the group
$uid_shared_with = array_diff($uid_shared_with, array($uid_owner)); $uid_shared_with = array_diff($uid_shared_with, array($uid_owner));
} else if (OC_User::userExists($uid_shared_with)) { } else if (OCP\User::userExists($uid_shared_with)) {
$userGroups = OC_Group::getUserGroups($uid_owner); $userGroups = OC_Group::getUserGroups($uid_owner);
// Check if the user is in one of the owner's groups // Check if the user is in one of the owner's groups
foreach ($userGroups as $group) { foreach ($userGroups as $group) {
......
...@@ -29,7 +29,7 @@ require_once(OC::$APPSROOT . '/apps/media/lib_collection.php'); ...@@ -29,7 +29,7 @@ require_once(OC::$APPSROOT . '/apps/media/lib_collection.php');
$user=isset($_POST['user'])?$_POST['user']:''; $user=isset($_POST['user'])?$_POST['user']:'';
$pass=isset($_POST['pass'])?$_POST['pass']:''; $pass=isset($_POST['pass'])?$_POST['pass']:'';
if(OC_User::checkPassword($user,$pass)){ if(OCP\User::checkPassword($user,$pass)){
OC_Util::setupFS($user); OC_Util::setupFS($user);
OC_MEDIA_COLLECTION::$uid=$user; OC_MEDIA_COLLECTION::$uid=$user;
}else{ }else{
......
...@@ -205,7 +205,7 @@ function authorize_mode () { ...@@ -205,7 +205,7 @@ function authorize_mode () {
$profile['idp_url']=$IDENTITY; $profile['idp_url']=$IDENTITY;
if (isset($_SERVER['PHP_AUTH_USER']) && $profile['authorized'] === false && $_SERVER['PHP_AUTH_USER']==$USERNAME) { if (isset($_SERVER['PHP_AUTH_USER']) && $profile['authorized'] === false && $_SERVER['PHP_AUTH_USER']==$USERNAME) {
if (OC_User::checkPassword($USERNAME, $_SERVER['PHP_AUTH_PW'])) {// successful login! if (OCP\User::checkPassword($USERNAME, $_SERVER['PHP_AUTH_PW'])) {// successful login!
// return to the refresh url if they get in // return to the refresh url if they get in
$_SESSION['openid_auth']=true; $_SESSION['openid_auth']=true;
$_SESSION['openid_user']=$USERNAME; $_SESSION['openid_user']=$USERNAME;
......
...@@ -39,7 +39,7 @@ $RUNTIME_NOAPPS=false; ...@@ -39,7 +39,7 @@ $RUNTIME_NOAPPS=false;
require_once '../../lib/base.php'; require_once '../../lib/base.php';
OC_Util::checkAppEnabled('user_openid'); OC_Util::checkAppEnabled('user_openid');
if(!OC_User::userExists($USERNAME)){ if(!OCP\User::userExists($USERNAME)){
OCP\Util::writeLog('user_openid',$USERNAME.' doesn\'t exist',OCP\Util::WARN); OCP\Util::writeLog('user_openid',$USERNAME.' doesn\'t exist',OCP\Util::WARN);
$USERNAME=''; $USERNAME='';
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment