summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-01 21:07:08 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-05-01 21:07:08 +0200
commite2fb094693e94d425fa9f59278806ef636fc127b (patch)
treec6c6b9535faa7f32b78fc3b0fedd24d85ffd0752 /lib
parentab584719049965f78d244879ce2a400a1955eec6 (diff)
downloadnextcloud-server-e2fb094693e94d425fa9f59278806ef636fc127b.tar.gz
nextcloud-server-e2fb094693e94d425fa9f59278806ef636fc127b.zip
some more porting
Diffstat (limited to 'lib')
-rw-r--r--lib/public/user.php31
-rw-r--r--lib/public/util.php39
-rw-r--r--lib/user.php2
-rw-r--r--lib/util.php6
4 files changed, 73 insertions, 5 deletions
diff --git a/lib/public/user.php b/lib/public/user.php
index f59fbe0b25a..febac06730f 100644
--- a/lib/public/user.php
+++ b/lib/public/user.php
@@ -53,10 +53,39 @@ class User {
return \OC_USER::isLoggedIn();
}
+ /**
+ * @brief check if a user exists
+ * @param string $uid the username
+ * @return boolean
+ */
+ public static function userExists($uid){
+ return \OC_USER::userExists($uid);
+ }
-}
+ /**
+ * @brief Loggs the user out including all the session data
+ * @returns true
+ *
+ * Logout, destroys session
+ */
+ public static function logout(){
+ return \OC_USER::logout();
+ }
+
+ /**
+ * @brief Check if the password is correct
+ * @param $uid The username
+ * @param $password The password
+ * @returns true/false
+ *
+ * Check if the password is correct without logging in the user
+ */
+ public static function checkPassword( $uid, $password ){
+ return \OC_USER::checkPassword($uid, $password);
+ }
+}
?>
diff --git a/lib/public/util.php b/lib/public/util.php
index 3e647fc6605..c4a73a5a7fc 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -40,6 +40,15 @@ class Util {
const FATAL=4;
/**
+ * get the current installed version of ownCloud
+ * @return array
+ */
+ public static function getVersion(){
+ return(\OC_Util::getVersion());
+ }
+
+
+ /**
* send an email
*
* @param string $toaddress
@@ -81,10 +90,38 @@ class Util {
\OC_Util::addStyle($application, $file);
}
+ /**
+ * add a javascript file
+ *
+ * @param appid $application
+ * @param filename $file
+ */
+ public static function addScript( $application, $file = null ){
+ \OC_Util::addScript($application, $file);
+ }
-}
+ /**
+ * @brief Add a custom element to the header
+ * @param string tag tag name of the element
+ * @param array $attributes array of attributes for the element
+ * @param string $text the text content for the element
+ */
+ public static function addHeader( $tag, $attributes, $text=''){
+ \OC_Util::addHeader($tag, $attribute, $text);
+ }
+ /**
+ * formats a timestamp in the "right" way
+ *
+ * @param int timestamp $timestamp
+ * @param bool dateOnly option to ommit time from the result
+ */
+ public static function formatDate( $timestamp,$dateOnly=false){
+ return(\OC_Util::formatDate($timestamp,$dateOnly));
+ }
+}
+
?>
diff --git a/lib/user.php b/lib/user.php
index 57ddb9e511b..8b887559df3 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -215,7 +215,7 @@ class OC_User {
}
/**
- * @brief Kick the user
+ * @brief Logs the current user out and kills all the session data
* @returns true
*
* Logout, destroys session
diff --git a/lib/util.php b/lib/util.php
index 5de5b8df384..d22d8710867 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -96,7 +96,8 @@ class OC_Util {
/**
* add a javascript file
*
- * @param url $url
+ * @param appid $application
+ * @param filename $file
*/
public static function addScript( $application, $file = null ){
if( is_null( $file )){
@@ -113,7 +114,8 @@ class OC_Util {
/**
* add a css file
*
- * @param url $url
+ * @param appid $application
+ * @param filename $file
*/
public static function addStyle( $application, $file = null ){
if( is_null( $file )){