]> source.dussan.org Git - nextcloud-server.git/commitdiff
some more porting
authorFrank Karlitschek <frank@owncloud.org>
Tue, 1 May 2012 19:07:08 +0000 (21:07 +0200)
committerFrank Karlitschek <frank@owncloud.org>
Tue, 1 May 2012 19:07:08 +0000 (21:07 +0200)
12 files changed:
apps/files/ajax/list.php [changed mode: 0644->0755]
apps/files/ajax/rawlist.php [changed mode: 0644->0755]
apps/files/index.php
apps/files_sharing/get.php [changed mode: 0644->0755]
apps/files_versions/ajax/getVersions.php
apps/files_versions/history.php [changed mode: 0644->0755]
apps/files_versions/templates/history.php [changed mode: 0644->0755]
apps/user_openid/appinfo/app.php
lib/public/user.php
lib/public/util.php
lib/user.php
lib/util.php

old mode 100644 (file)
new mode 100755 (executable)
index 8391433..0bff574
@@ -33,7 +33,7 @@ if($doBreadcrumb){
 // make filelist
 $files = array();
 foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
-       $i["date"] = OC_Util::formatDate($i["mtime"] );
+       $i["date"] = OCP\Util::formatDate($i["mtime"] );
        $files[] = $i;
 }
 
old mode 100644 (file)
new mode 100755 (executable)
index 0b37b93..86119de
@@ -16,7 +16,7 @@ $mimetype = isset($_GET['mimetype']) ? $_GET['mimetype'] : '';
 // make filelist
 $files = array();
 foreach( OC_Files::getdirectorycontent( $dir, $mimetype ) as $i ){
-       $i["date"] = OC_Util::formatDate($i["mtime"] );
+       $i["date"] = OCP\Util::formatDate($i["mtime"] );
   $i['mimetype_icon'] = $i['type'] == 'dir' ? mimetype_icon('dir'): mimetype_icon($i['mimetype']);
        $files[] = $i;
 }
index c1b99cfaf5a2d56b4ad15308c8f484472de4e2ba..180452593ab9a541d8595ef8519d8bc64fd8e922 100755 (executable)
@@ -44,7 +44,7 @@ if(!OC_Filesystem::is_dir($dir.'/')) {
 
 $files = array();
 foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
-       $i["date"] = OC_Util::formatDate($i["mtime"] );
+       $i["date"] = OCP\Util::formatDate($i["mtime"] );
        if($i['type']=='file'){
                $fileinfo=pathinfo($i['name']);
                $i['basename']=$fileinfo['filename'];
old mode 100644 (file)
new mode 100755 (executable)
index fbcb265..f6ae4bf
@@ -27,7 +27,7 @@ if ($source !== false) {
                $files = array();
                $rootLength = strlen($root);
                foreach (OC_Files::getdirectorycontent($source) as $i) {
-                       $i['date'] = OC_Util::formatDate($i['mtime'] );
+                       $i['date'] = OCP\Util::formatDate($i['mtime'] );
                        if ($i['type'] == 'file') {
                                $fileinfo = pathinfo($i['name']);
                                $i['basename'] = $fileinfo['filename'];
index 9f5b5908797e29c190c2d7726d644812b24150fa..d12cf368f18b2b7823a437ba4e454e5895784fb0 100755 (executable)
@@ -16,7 +16,7 @@ if( OCA_Versions\Storage::isversioned( $source ) ) {
        
        foreach ( $versions AS $version ) {
        
-               $versionsFormatted[] = OC_Util::formatDate( $version );
+               $versionsFormatted[] = OCP\Util::formatDate( $version );
                
        }
 
old mode 100644 (file)
new mode 100755 (executable)
index 16ad92b..d806638
@@ -39,13 +39,13 @@ if ( isset( $_GET['path'] ) ) {
                        
                        $tmpl->assign( 'outcome_stat', 'success' );
                        
-                       $tmpl->assign( 'outcome_msg', "File {$_GET['path']} was reverted to version ".OC_Util::formatDate( $_GET['revert'] ) );
+                       $tmpl->assign( 'outcome_msg', "File {$_GET['path']} was reverted to version ".OCP\Util::formatDate( $_GET['revert'] ) );
                        
                } else {
                
                        $tmpl->assign( 'outcome_stat', 'failure' );
                
-                       $tmpl->assign( 'outcome_msg', "File {$_GET['path']} could not be reverted to version ".OC_Util::formatDate( $_GET['revert'] ) );
+                       $tmpl->assign( 'outcome_msg', "File {$_GET['path']} could not be reverted to version ".OCP\Util::formatDate( $_GET['revert'] ) );
                        
                }
                
old mode 100644 (file)
new mode 100755 (executable)
index 2ef0c89..3b29625
@@ -22,7 +22,7 @@ if( isset( $_['message'] ) ) {
        foreach ( $_['versions'] as $v ) {
        
                echo ' ';
-               echo OC_Util::formatDate( $v );
+               echo OCP\Util::formatDate( $v );
                echo ' <a href="history.php?path='.urlencode( $_['path'] ).'&revert='. $v .'" class="button">Revert</a><br /><br />';
                
        }
index 867a0a3ed33380110e63bfce0d19e27e905390c8..3e26d922689b3e9470c13ca935b244c14ce98b1e 100755 (executable)
@@ -14,8 +14,8 @@ if(strpos($_SERVER["REQUEST_URI"],'?') and !strpos($_SERVER["REQUEST_URI"],'='))
        }
 }
 
-OC_Util::addHeader('link',array('rel'=>'openid.server', 'href'=>OC_Helper::linkToAbsolute( "user_openid", "user.php" ).'/'.$userName));
-OC_Util::addHeader('link',array('rel'=>'openid.delegate', 'href'=>OC_Helper::linkToAbsolute( "user_openid", "user.php" ).'/'.$userName));
+OCP\Util::addHeader('link',array('rel'=>'openid.server', 'href'=>OC_Helper::linkToAbsolute( "user_openid", "user.php" ).'/'.$userName));
+OCP\Util::addHeader('link',array('rel'=>'openid.delegate', 'href'=>OC_Helper::linkToAbsolute( "user_openid", "user.php" ).'/'.$userName));
 
 OC_APP::registerPersonal('user_openid','settings');
 
index f59fbe0b25af023dd135b4bfb4c6df46c1d5f957..febac06730f4cdea5399ffd18f4c5ee26a01db32 100644 (file)
@@ -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);
+       }
 
 
+}
 
 
 ?>
index 3e647fc6605a0aabb92ba0463296eea47ac66814..c4a73a5a7fc2d153629268141d093b6898108b8f 100644 (file)
@@ -39,6 +39,15 @@ class Util {
        const ERROR=3;
        const FATAL=4;
 
+       /**
+        * get the current installed version of ownCloud
+        * @return array
+        */
+       public static function getVersion(){
+               return(\OC_Util::getVersion());
+       }
+
+
        /**
         * send an email 
         *
@@ -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));
+       }
 
 
 
+}
+
 ?>
index 57ddb9e511b9cc3154ec9b3eee3467630dd27d32..8b887559df3d5e0ea9786196362740a7133f86f2 100644 (file)
@@ -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
index 5de5b8df384f671e94f25cd40c7faf9faac30224..d22d8710867379649633a7f4f3a1969a0ca46848 100644 (file)
@@ -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 )){