소스 검색

some more porting

tags/v4.0.0beta
Frank Karlitschek 12 년 전
부모
커밋
e2fb094693

+ 1
- 1
apps/files/ajax/list.php 파일 보기

@@ -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;
}


+ 1
- 1
apps/files/ajax/rawlist.php 파일 보기

@@ -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;
}

+ 1
- 1
apps/files/index.php 파일 보기

@@ -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'];

+ 1
- 1
apps/files_sharing/get.php 파일 보기

@@ -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'];

+ 1
- 1
apps/files_versions/ajax/getVersions.php 파일 보기

@@ -16,7 +16,7 @@ if( OCA_Versions\Storage::isversioned( $source ) ) {
foreach ( $versions AS $version ) {
$versionsFormatted[] = OC_Util::formatDate( $version );
$versionsFormatted[] = OCP\Util::formatDate( $version );
}


+ 2
- 2
apps/files_versions/history.php 파일 보기

@@ -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'] ) );
}

+ 1
- 1
apps/files_versions/templates/history.php 파일 보기

@@ -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 />';
}

+ 2
- 2
apps/user_openid/appinfo/app.php 파일 보기

@@ -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');


+ 30
- 1
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);
}


}


?>

+ 38
- 1
lib/public/util.php 파일 보기

@@ -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));
}



}

?>

+ 1
- 1
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

+ 4
- 2
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 )){

Loading…
취소
저장