// 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;
}
// 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;
}
$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'];
$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'];
foreach ( $versions AS $version ) {
- $versionsFormatted[] = OC_Util::formatDate( $version );
+ $versionsFormatted[] = OCP\Util::formatDate( $version );
}
$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'] ) );
}
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 />';
}
}
}
-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');
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);
+ }
+}
?>
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
*
\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));
+ }
+}
+
?>
}
/**
- * @brief Kick the user
+ * @brief Logs the current user out and kills all the session data
* @returns true
*
* Logout, destroys session
/**
* add a javascript file
*
- * @param url $url
+ * @param appid $application
+ * @param filename $file
*/
public static function addScript( $application, $file = null ){
if( is_null( $file )){
/**
* add a css file
*
- * @param url $url
+ * @param appid $application
+ * @param filename $file
*/
public static function addStyle( $application, $file = null ){
if( is_null( $file )){