$filename = $_FILES['rootcert_import']['name'];
$view = new \OC\Files\View('/'.\OCP\User::getUser().'/files_external/uploads');
-if (!$view->file_exists('')){
+if (!$view->file_exists('')) {
$view->mkdir('');
}
private $ready = false;
protected function init(){
- if($this->ready){
+ if($this->ready) {
return;
}
$this->ready = true;
}
private function init(){
- if($this->ready){
+ if($this->ready) {
return;
}
$this->ready = true;
}
private function init(){
- if($this->ready){
+ if($this->ready) {
return;
}
$this->ready = true;
// expire old revisions if necessary
$newSize = self::expire($filename, $versionsSize);
- if ( $newSize != $versionsSize ) {
+ if ( $newSize != $versionsSize ) {
\OCP\Config::setAppValue('files_versions', 'size', $versionsSize);
}
}
OCP\JSON::callCheck();
$prefix = $_POST['ldap_serverconfig_chooser'];
-if(\OCA\user_ldap\lib\Helper::deleteServerConfiguration($prefix)){
+if(\OCA\user_ldap\lib\Helper::deleteServerConfiguration($prefix)) {
OCP\JSON::success();
} else {
$l=OC_L10N::get('user_ldap');
OCP\JSON::error(array('message' => $l->t('Failed to delete the server configuration')));
-}
\ No newline at end of file
+}
private function getValue($varname) {
static $defaults;
- if(is_null($defaults)){
+ if(is_null($defaults)) {
$defaults = $this->getDefaults();
}
return \OCP\Config::getAppValue($this->configID,
case 'ldapBaseGroups':
case 'ldapAttributesForUserSearch':
case 'ldapAttributesForGroupSearch':
- if(is_array($value)){
+ if(is_array($value)) {
$value = implode("\n", $value);
}
break;
// Prepare the request variables
if($_SERVER['REQUEST_METHOD'] == 'PUT') {
parse_str(file_get_contents("php://input"), $parameters['_put']);
- } else if($_SERVER['REQUEST_METHOD'] == 'DELETE'){
+ } else if($_SERVER['REQUEST_METHOD'] == 'DELETE') {
parse_str(file_get_contents("php://input"), $parameters['_delete']);
}
$name = $parameters['_route'];
*/
public static function isShipped($appid){
$info = self::getAppInfo($appid);
- if(isset($info['shipped']) && $info['shipped']=='true'){
+ if(isset($info['shipped']) && $info['shipped']=='true') {
return true;
} else {
return false;
OC_Appconfig::setValue( $app, 'enabled', 'no' );
// check if app is a shipped app or not. if not delete
- if(!OC_App::isShipped( $app )){
+ if(!OC_App::isShipped( $app )) {
OC_Installer::removeApp( $app );
}
}
$app1[$i]['ocs_id'] = $app['id'];
$app1[$i]['internal'] = $app1[$i]['active'] = 0;
$app1[$i]['update'] = false;
- if($app['label']=='recommended'){
+ if($app['label']=='recommended') {
$app1[$i]['internallabel'] = 'Recommended';
$app1[$i]['internalclass'] = 'recommendedapp';
}else{
}
$request = OC_Request::getPathInfo();
- if(substr($request, -3) !== '.js'){// we need these files during the upgrade
+ if(substr($request, -3) !== '.js') {// we need these files during the upgrade
self::checkMaintenanceMode();
self::checkUpgrade();
}
* @return string
*/
public function getRawServerValue($field) {
- if($field == 'REQUEST_URI'){
+ if($field == 'REQUEST_URI') {
return $this->getUri();
}
else{
static $rootView;
public function premkdir($path) {
- if(!self::$rootView){
+ if(!self::$rootView) {
self::$rootView = new \OC\Files\View('');
}
return !self::$rootView->file_exists($path);
}
public function preCopy($path1, $path2) {
- if(!self::$rootView){
+ if(!self::$rootView) {
self::$rootView = new \OC\Files\View('');
}
return (self::$rootView->filesize($path1)<$this->getFreeSpace($path2) or $this->getFreeSpace($path2)==-1);
* @param \OC\Files\Storage\Storage|string $storage
*/
public function __construct($storage){
- if($storage instanceof \OC\Files\Storage\Storage){
+ if($storage instanceof \OC\Files\Storage\Storage) {
$this->storageId = $storage->getId();
}else{
$this->storageId = $storage;
}
public function getPermissions($path){
$permissions = 0;
- if($this->isCreatable($path)){
+ if($this->isCreatable($path)) {
$permissions |= \OCP\PERMISSION_CREATE;
}
- if($this->isReadable($path)){
+ if($this->isReadable($path)) {
$permissions |= \OCP\PERMISSION_READ;
}
- if($this->isUpdatable($path)){
+ if($this->isUpdatable($path)) {
$permissions |= \OCP\PERMISSION_UPDATE;
}
- if($this->isDeletable($path)){
+ if($this->isDeletable($path)) {
$permissions |= \OCP\PERMISSION_DELETE;
}
- if($this->isSharable($path)){
+ if($this->isSharable($path)) {
$permissions |= \OCP\PERMISSION_SHARE;
}
return $permissions;
public static function isUpdateAvailable( $app ) {
$ocsid=OC_Appconfig::getValue( $app, 'ocsid', '');
- if($ocsid<>''){
+ if($ocsid<>'') {
$ocsdata=OC_OCSClient::getApplication($ocsid);
$ocsversion= (string) $ocsdata['version'];
$currentversion=OC_App::getAppVersion($app);
- if($ocsversion<>$currentversion){
+ if($ocsversion<>$currentversion) {
return($ocsversion);
}else{
*/
public static function removeApp( $name, $options = array()) {
- if(isset($options['keeppreferences']) and $options['keeppreferences']==false ){
+ if(isset($options['keeppreferences']) and $options['keeppreferences']==false ) {
// todo
// remove preferences
}
- if(isset($options['keepappconfig']) and $options['keepappconfig']==false ){
+ if(isset($options['keepappconfig']) and $options['keepappconfig']==false ) {
// todo
// remove app config
}
- if(isset($options['keeptables']) and $options['keeptables']==false ){
+ if(isset($options['keeptables']) and $options['keeptables']==false ) {
// todo
// remove app database tables
}
- if(isset($options['keepfiles']) and $options['keepfiles']==false ){
+ if(isset($options['keepfiles']) and $options['keepfiles']==false ) {
// todo
// remove user files
}
$app = addslashes(strip_tags($parameters['app']));
$key = addslashes(strip_tags($parameters['key']));
$value = OC_OCS::readData('post', 'value', 'text');
- if(OC_Preferences::setValue($user, $app, $key, $value)){
+ if(OC_Preferences::setValue($user, $app, $key, $value)) {
return new OC_OCS_Result(null, 100);
}
}
$handler = ini_get("session.save_handler");
if($handler == "files") {
$tmpDir = session_save_path();
- if($tmpDir != ""){
- if(!@is_writable($tmpDir)){
+ if($tmpDir != "") {
+ if(!@is_writable($tmpDir)) {
$errors[]=array('error' => 'The temporary folder used by PHP to save the session data is either incorrect or not writable! Please check : '.session_save_path().'<br/>',
'hint'=>'Please ask your server administrator to grant write access or define another temporary folder.');
}
case 'register':
// Here external apps can register with an ownCloud
- if(empty($_GET['name']) || empty($_GET['url'])){
+ if(empty($_GET['name']) || empty($_GET['url'])) {
// Invalid request
echo 401;
} else {
foreach($consumer['scopes'] as $requiredapp){
// App scopes are in this format: app_$appname
$requiredapp = end(explode('_', $requiredapp));
- if(!in_array($requiredapp, $apps)){
+ if(!in_array($requiredapp, $apps)) {
$notfound[] = $requiredapp;
}
}
- if(!empty($notfound)){
+ if(!empty($notfound)) {
// We need more apps :( Show error
- if(count($notfound)==1){
+ if(count($notfound)==1) {
$message = 'requires that you have an extra app installed on your ownCloud. Please contact your ownCloud administrator and ask them to install the app below.';
} else {
$message = 'requires that you have some extra apps installed on your ownCloud. Please contract your ownCloud administrator and ask them to install the apps below.';