diff --git a/ajax/categories/delete.php b/ajax/categories/delete.php index f4e7ba76..d1099da0 100755 --- a/ajax/categories/delete.php +++ b/ajax/categories/delete.php @@ -31,7 +31,7 @@ if(is_null($categories)) { debug(print_r($categories, true)); -$addressbooks = OC_Contacts_Addressbook::all(OC_User::getUser()); +$addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser()); if(count($addressbooks) == 0) { bailOut(OC_Contacts_App::$l10n->t('No address books found.')); } diff --git a/ajax/categories/rescan.php b/ajax/categories/rescan.php index 97fd1b22..37a19fbc 100755 --- a/ajax/categories/rescan.php +++ b/ajax/categories/rescan.php @@ -23,7 +23,7 @@ function debug($msg) { OCP\Util::writeLog('contacts','ajax/categories/rescan.php: '.$msg, OCP\Util::DEBUG); } -$addressbooks = OC_Contacts_Addressbook::all(OC_User::getUser()); +$addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser()); if(count($addressbooks) == 0) { bailOut(OC_Contacts_App::$l10n->t('No address books found.')); } diff --git a/ajax/contacts.php b/ajax/contacts.php old mode 100644 new mode 100755 index 3e75e4c8..f0e7dde0 --- a/ajax/contacts.php +++ b/ajax/contacts.php @@ -10,7 +10,7 @@ OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); -$ids = OC_Contacts_Addressbook::activeIds(OC_User::getUser()); +$ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser()); $contacts = OC_Contacts_VCard::all($ids); $tmpl = new OC_TEMPLATE("contacts", "part.contacts"); $tmpl->assign('contacts', $contacts); diff --git a/ajax/createaddressbook.php b/ajax/createaddressbook.php index 6c9976f6..3a331131 100755 --- a/ajax/createaddressbook.php +++ b/ajax/createaddressbook.php @@ -12,7 +12,7 @@ OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); -$userid = OC_User::getUser(); +$userid = OCP\USER::getUser(); $name = trim(strip_tags($_POST['name'])); if(!$name) { OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot add addressbook with an empty name.')))); diff --git a/ajax/editname.php b/ajax/editname.php index 0baa9403..9ff85dd8 100755 --- a/ajax/editname.php +++ b/ajax/editname.php @@ -33,7 +33,7 @@ if($id) { $tmpl->assign('name',$name); $tmpl->assign('id',$id); } else { - $addressbooks = OC_Contacts_Addressbook::active(OC_User::getUser()); + $addressbooks = OC_Contacts_Addressbook::active(OCP\USER::getUser()); $tmpl->assign('addressbooks', $addressbooks); } $tmpl->printpage(); diff --git a/import.php b/import.php index 8fb1c055..95f17a88 100755 --- a/import.php +++ b/import.php @@ -30,7 +30,7 @@ if(!$file) { } error_log('File: '.$file); if(isset($_POST['method']) && $_POST['method'] == 'new'){ - $id = OC_Contacts_Addressbook::add(OC_User::getUser(), $_POST['addressbookname']); + $id = OC_Contacts_Addressbook::add(OCP\USER::getUser(), $_POST['addressbookname']); OC_Contacts_Addressbook::setActive($id, 1); }else{ $id = $_POST['id']; diff --git a/index.php b/index.php old mode 100644 new mode 100755 index 0abec096..70daf4ab --- a/index.php +++ b/index.php @@ -13,10 +13,10 @@ OC_Util::checkLoggedIn(); OC_Util::checkAppEnabled('contacts'); // Get active address books. This creates a default one if none exists. -$ids = OC_Contacts_Addressbook::activeIds(OC_User::getUser()); +$ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser()); $contacts = OC_Contacts_VCard::all($ids); -$addressbooks = OC_Contacts_Addressbook::active(OC_User::getUser()); +$addressbooks = OC_Contacts_Addressbook::active(OCP\USER::getUser()); // Load the files we need OC_App::setActiveNavigationEntry( 'contacts_index' ); diff --git a/lib/addressbook.php b/lib/addressbook.php index bf1cb932..6aed9590 100755 --- a/lib/addressbook.php +++ b/lib/addressbook.php @@ -166,7 +166,7 @@ class OC_Contacts_Addressbook{ */ public static function activeIds($uid = null){ if(is_null($uid)){ - $uid = OC_User::getUser(); + $uid = OCP\USER::getUser(); } $prefbooks = OC_Preferences::getValue($uid,'contacts','openaddressbooks',null); if(!$prefbooks){ @@ -235,7 +235,7 @@ class OC_Contacts_Addressbook{ $openaddressbooks = self::cleanArray($openaddressbooks, false); sort($openaddressbooks, SORT_NUMERIC); // FIXME: I alway end up with a ';' prepending when imploding the array..? - OC_Preferences::setValue(OC_User::getUser(),'contacts','openaddressbooks',implode(';', $openaddressbooks)); + OC_Preferences::setValue(OCP\USER::getUser(),'contacts','openaddressbooks',implode(';', $openaddressbooks)); return true; } diff --git a/lib/app.php b/lib/app.php index 26ea6d06..4e840026 100755 --- a/lib/app.php +++ b/lib/app.php @@ -17,13 +17,13 @@ class OC_Contacts_App { public static function getAddressbook($id) { $addressbook = OC_Contacts_Addressbook::find( $id ); - if( $addressbook === false || $addressbook['userid'] != OC_User::getUser()) { + if( $addressbook === false || $addressbook['userid'] != OCP\USER::getUser()) { if ($addressbook === false) { OCP\Util::writeLog('contacts', 'Addressbook not found: '. $id, OCP\Util::ERROR); OC_JSON::error(array('data' => array( 'message' => self::$l10n->t('Addressbook not found.')))); } else { - OCP\Util::writeLog('contacts', 'Addressbook('.$id.') is not from '.OC_User::getUser(), OCP\Util::ERROR); + OCP\Util::writeLog('contacts', 'Addressbook('.$id.') is not from '.OCP\USER::getUser(), OCP\Util::ERROR); OC_JSON::error(array('data' => array( 'message' => self::$l10n->t('This is not your addressbook.')))); } exit(); @@ -145,7 +145,7 @@ class OC_Contacts_App { */ public static function scanCategories($vccontacts = null) { if (is_null($vccontacts)) { - $vcaddressbooks = OC_Contacts_Addressbook::all(OC_User::getUser()); + $vcaddressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser()); if(count($vcaddressbooks) > 0) { $vcaddressbookids = array(); foreach($vcaddressbooks as $vcaddressbook) { diff --git a/lib/hooks.php b/lib/hooks.php old mode 100644 new mode 100755 index b858c4a5..9939075a --- a/lib/hooks.php +++ b/lib/hooks.php @@ -41,7 +41,7 @@ class OC_Contacts_Hooks{ static public function getCalenderSources($parameters) { $base_url = OC_Helper::linkTo('calendar', 'ajax/events.php').'?calendar_id='; - foreach(OC_Contacts_Addressbook::all(OC_User::getUser()) as $addressbook) { + foreach(OC_Contacts_Addressbook::all(OCP\USER::getUser()) as $addressbook) { $parameters['sources'][] = array( 'url' => $base_url.'birthday_'. $addressbook['id'], diff --git a/lib/search.php b/lib/search.php old mode 100644 new mode 100755 index 31d85420..a53556d8 --- a/lib/search.php +++ b/lib/search.php @@ -1,7 +1,7 @@ var totalurl = '/addressbooks'; var categories = ; - var lang = ''; + var lang = '';