diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-02-21 12:46:09 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-02-21 12:46:09 +0100 |
commit | 80481a1e41fe568d1aec3ab82789e0f8c649c79c (patch) | |
tree | 6d8d99656272103a9bf570793c58179728506a32 /core | |
parent | d5739e83d16dd4af1865999180c7867a7f77734f (diff) | |
parent | fc209a594445fbea503332e601df2f253c64de7b (diff) | |
download | nextcloud-server-80481a1e41fe568d1aec3ab82789e0f8c649c79c.tar.gz nextcloud-server-80481a1e41fe568d1aec3ab82789e0f8c649c79c.zip |
Merge branch 'master' into mobile-header
Diffstat (limited to 'core')
-rw-r--r-- | core/ajax/appconfig.php | 27 | ||||
-rw-r--r-- | core/ajax/share.php | 112 | ||||
-rw-r--r-- | core/css/fixes.css | 5 | ||||
-rw-r--r-- | core/css/multiselect.css | 8 | ||||
-rw-r--r-- | core/css/styles.css | 30 | ||||
-rw-r--r-- | core/img/filetypes/application-javascript.png (renamed from core/img/filetypes/text-x-javascript.png) | bin | 1243 -> 1243 bytes | |||
-rw-r--r-- | core/img/filetypes/application-javascript.svg (renamed from core/img/filetypes/text-x-javascript.svg) | 0 | ||||
-rw-r--r-- | core/img/filetypes/application-x-shockwave-flash.png (renamed from core/img/filetypes/flash.png) | bin | 880 -> 880 bytes | |||
-rw-r--r-- | core/img/filetypes/application-x-shockwave-flash.svg (renamed from core/img/filetypes/flash.svg) | 0 | ||||
-rw-r--r-- | core/img/filetypes/text-calendar.png (renamed from core/img/filetypes/calendar.png) | bin | 1226 -> 1226 bytes | |||
-rw-r--r-- | core/img/filetypes/text-calendar.svg (renamed from core/img/filetypes/calendar.svg) | 0 | ||||
-rw-r--r-- | core/js/config.php | 1 | ||||
-rw-r--r-- | core/templates/layout.guest.php | 2 | ||||
-rw-r--r-- | core/templates/layout.user.php | 5 |
14 files changed, 76 insertions, 114 deletions
diff --git a/core/ajax/appconfig.php b/core/ajax/appconfig.php index 4f26dedc797..05b7572c6d7 100644 --- a/core/ajax/appconfig.php +++ b/core/ajax/appconfig.php @@ -9,28 +9,43 @@ OC_Util::checkAdminUser(); OCP\JSON::callCheck(); $action=isset($_POST['action'])?$_POST['action']:$_GET['action']; + +if(isset($_POST['app']) || isset($_GET['app'])) { + $app=OC_App::cleanAppId(isset($_POST['app'])?$_POST['app']:$_GET['app']); +} + +// An admin should not be able to add remote and public services +// on its own. This should only be possible programmatically. +// This change is due the fact that an admin may not be expected +// to execute arbitrary code in every environment. +if($app === 'core' && isset($_POST['key']) &&(substr($_POST['key'],0,7) === 'remote_' || substr($_POST['key'],0,7) === 'public_')) { + OC_JSON::error(array('data' => array('message' => 'Unexpected error!'))); + return; +} + $result=false; switch($action) { case 'getValue': - $result=OC_Appconfig::getValue($_GET['app'], $_GET['key'], $_GET['defaultValue']); + $result=OC_Appconfig::getValue($app, $_GET['key'], $_GET['defaultValue']); break; case 'setValue': - $result=OC_Appconfig::setValue($_POST['app'], $_POST['key'], $_POST['value']); + $result=OC_Appconfig::setValue($app, $_POST['key'], $_POST['value']); break; case 'getApps': $result=OC_Appconfig::getApps(); break; case 'getKeys': - $result=OC_Appconfig::getKeys($_GET['app']); + $result=OC_Appconfig::getKeys($app); break; case 'hasKey': - $result=OC_Appconfig::hasKey($_GET['app'], $_GET['key']); + $result=OC_Appconfig::hasKey($app, $_GET['key']); break; case 'deleteKey': - $result=OC_Appconfig::deleteKey($_POST['app'], $_POST['key']); + $result=OC_Appconfig::deleteKey($app, $_POST['key']); break; case 'deleteApp': - $result=OC_Appconfig::deleteApp($_POST['app']); + $result=OC_Appconfig::deleteApp($app); break; } OC_JSON::success(array('data'=>$result)); + diff --git a/core/ajax/share.php b/core/ajax/share.php index c251f8e7bae..86ee018e388 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -85,93 +85,32 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo } break; case 'informRecipients': - $l = OC_L10N::get('core'); - $shareType = (int) $_POST['shareType']; $itemType = $_POST['itemType']; $itemSource = $_POST['itemSource']; $recipient = $_POST['recipient']; - $ownerDisplayName = \OCP\User::getDisplayName(); - $from = \OCP\Util::getDefaultEmailAddress('sharing-noreply'); - - $noMail = array(); - $recipientList = array(); if($shareType === \OCP\Share::SHARE_TYPE_USER) { $recipientList[] = $recipient; } elseif ($shareType === \OCP\Share::SHARE_TYPE_GROUP) { $recipientList = \OC_Group::usersInGroup($recipient); } - // don't send a mail to the user who shared the file $recipientList = array_diff($recipientList, array(\OCP\User::getUser())); - // send mail to all recipients with an email address - foreach ($recipientList as $recipient) { - //get correct target folder name - $email = OC_Preferences::getValue($recipient, 'settings', 'email', ''); - - if ($email !== '') { - $displayName = \OCP\User::getDisplayName($recipient); - $items = \OCP\Share::getItemSharedWithUser($itemType, $itemSource, $recipient); - $filename = trim($items[0]['file_target'], '/'); - $subject = (string)$l->t('%s shared »%s« with you', array($ownerDisplayName, $filename)); - $expiration = null; - if (isset($items[0]['expiration'])) { - try { - $date = new DateTime($items[0]['expiration']); - $expiration = $l->l('date', $date->getTimestamp()); - } catch (Exception $e) { - \OCP\Util::writeLog('sharing', "Couldn't read date: " . $e->getMessage(), \OCP\Util::ERROR); - } - } - - if ($itemType === 'folder') { - $foldername = "/Shared/" . $filename; - } else { - // if it is a file we can just link to the Shared folder, - // that's the place where the user will find the file - $foldername = "/Shared"; - } - - $link = \OCP\Util::linkToAbsolute('files', 'index.php', array("dir" => $foldername)); - - $content = new OC_Template("core", "mail", ""); - $content->assign('link', $link); - $content->assign('user_displayname', $ownerDisplayName); - $content->assign('filename', $filename); - $content->assign('expiration', $expiration); - $text = $content->fetchPage(); - - $content = new OC_Template("core", "altmail", ""); - $content->assign('link', $link); - $content->assign('user_displayname', $ownerDisplayName); - $content->assign('filename', $filename); - $content->assign('expiration', $expiration); - $alttext = $content->fetchPage(); - - $default_from = OCP\Util::getDefaultEmailAddress('sharing-noreply'); - $from = OCP\Config::getUserValue(\OCP\User::getUser(), 'settings', 'email', $default_from); - - // send it out now - try { - OCP\Util::sendMail($email, $displayName, $subject, $text, $from, $ownerDisplayName, 1, $alttext); - } catch (Exception $exception) { - $noMail[] = \OCP\User::getDisplayName($recipient); - } - } - } + $mailNotification = new OC\Share\MailNotifications(); + $result = $mailNotification->sendInternalShareMail($recipientList, $itemSource, $itemType); \OCP\Share::setSendMailStatus($itemType, $itemSource, $shareType, true); - if (empty($noMail)) { + if (empty($result)) { OCP\JSON::success(); } else { OCP\JSON::error(array( 'data' => array( 'message' => $l->t("Couldn't send mail to following users: %s ", - implode(', ', $noMail) + implode(', ', $result) ) ) )); @@ -187,56 +126,31 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo break; case 'email': - // enable l10n support - $l = OC_L10N::get('core'); // read post variables - $user = OCP\USER::getUser(); - $displayName = OCP\User::getDisplayName(); - $type = $_POST['itemType']; $link = $_POST['link']; $file = $_POST['file']; $to_address = $_POST['toaddress']; + $mailNotification = new \OC\Share\MailNotifications(); + $expiration = null; if (isset($_POST['expiration']) && $_POST['expiration'] !== '') { try { $date = new DateTime($_POST['expiration']); - $expiration = $l->l('date', $date->getTimestamp()); + $expiration = $date->getTimestamp(); } catch (Exception $e) { \OCP\Util::writeLog('sharing', "Couldn't read date: " . $e->getMessage(), \OCP\Util::ERROR); } } - // setup the email - $subject = (string)$l->t('%s shared »%s« with you', array($displayName, $file)); - - $content = new OC_Template("core", "mail", ""); - $content->assign ('link', $link); - $content->assign ('type', $type); - $content->assign ('user_displayname', $displayName); - $content->assign ('filename', $file); - $content->assign('expiration', $expiration); - $text = $content->fetchPage(); - - $content = new OC_Template("core", "altmail", ""); - $content->assign ('link', $link); - $content->assign ('type', $type); - $content->assign ('user_displayname', $displayName); - $content->assign ('filename', $file); - $content->assign('expiration', $expiration); - $alttext = $content->fetchPage(); - - $default_from = OCP\Util::getDefaultEmailAddress('sharing-noreply'); - $from_address = OCP\Config::getUserValue($user, 'settings', 'email', $default_from ); - - // send it out now - try { - OCP\Util::sendMail($to_address, $to_address, $subject, $text, $from_address, $displayName, 1, $alttext); - OCP\JSON::success(); - } catch (Exception $exception) { - OCP\JSON::error(array('data' => array('message' => OC_Util::sanitizeHTML($exception->getMessage())))); + $result = $mailNotification->sendLinkShareMail($to_address, $file, $link, $expiration); + if($result === true) { + \OCP\JSON::success(); + } else { + \OCP\JSON::error(array('data' => array('message' => OC_Util::sanitizeHTML($result)))); } + break; } } else if (isset($_GET['fetch'])) { diff --git a/core/css/fixes.css b/core/css/fixes.css index 4ee854addef..a33afd5cf77 100644 --- a/core/css/fixes.css +++ b/core/css/fixes.css @@ -54,11 +54,6 @@ background-color: #1B314D; } -/* in IE9 the nav bar on the left side is too narrow and leave a white area - original width is 80px */ -.ie9 #navigation { - width: 100px; -} - /* IE8 isn't able to display transparent background. So it is specified using a gradient */ .ie8 #nojavascript { filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#4c320000', endColorstr='#4c320000'); /* IE */ diff --git a/core/css/multiselect.css b/core/css/multiselect.css index 60f2f47e698..8d949e7cdb7 100644 --- a/core/css/multiselect.css +++ b/core/css/multiselect.css @@ -48,7 +48,7 @@ ul.multiselectoptions > li input[type='checkbox']:checked+label { font-weight: bold; } -div.multiselect { +div.multiselect, select.multiselect { display: inline-block; max-width: 400px; min-width: 150px; @@ -58,6 +58,12 @@ div.multiselect { vertical-align: bottom; } +/* To make a select look like a multiselect until it's initialized */ +select.multiselect { + height: 30px; + min-width: 113px; +} + div.multiselect.active { background-color: #fff; position: relative; diff --git a/core/css/styles.css b/core/css/styles.css index 1c80a3ea160..341a507ce37 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -75,6 +75,19 @@ body { background:#fefefe; font:normal .8em/1.6em "Helvetica Neue",Helvetica,Ari color: #aaa; } +#header .logo { + background-image: url(../img/logo.svg); + width: 250px; + height: 118px; + margin: 0 auto; +} + +#header .logo-wide { + background-image: url(../img/logo-wide.svg); + width: 147px; + height: 32px; +} + /* INPUTS */ input[type="text"], input[type="password"], @@ -935,3 +948,20 @@ div.crumb:active { opacity:.7; } +.appear { + opacity: 1; + transition: opacity 500ms ease 0s; + -moz-transition: opacity 500ms ease 0s; + -ms-transition: opacity 500ms ease 0s; + -o-transition: opacity 500ms ease 0s; + -webkit-transition: opacity 500ms ease 0s; +} +.appear.transparent { + opacity: 0; +} + +/* for IE10 */ +@-ms-viewport { + width: device-width; +} + diff --git a/core/img/filetypes/text-x-javascript.png b/core/img/filetypes/application-javascript.png Binary files differindex 1e1d3140f63..1e1d3140f63 100644 --- a/core/img/filetypes/text-x-javascript.png +++ b/core/img/filetypes/application-javascript.png diff --git a/core/img/filetypes/text-x-javascript.svg b/core/img/filetypes/application-javascript.svg index 4e9819bb685..4e9819bb685 100644 --- a/core/img/filetypes/text-x-javascript.svg +++ b/core/img/filetypes/application-javascript.svg diff --git a/core/img/filetypes/flash.png b/core/img/filetypes/application-x-shockwave-flash.png Binary files differindex 75424f81d68..75424f81d68 100644 --- a/core/img/filetypes/flash.png +++ b/core/img/filetypes/application-x-shockwave-flash.png diff --git a/core/img/filetypes/flash.svg b/core/img/filetypes/application-x-shockwave-flash.svg index b373fd6512d..b373fd6512d 100644 --- a/core/img/filetypes/flash.svg +++ b/core/img/filetypes/application-x-shockwave-flash.svg diff --git a/core/img/filetypes/calendar.png b/core/img/filetypes/text-calendar.png Binary files differindex d5c666a7695..d5c666a7695 100644 --- a/core/img/filetypes/calendar.png +++ b/core/img/filetypes/text-calendar.png diff --git a/core/img/filetypes/calendar.svg b/core/img/filetypes/text-calendar.svg index 7d62bb8fa12..7d62bb8fa12 100644 --- a/core/img/filetypes/calendar.svg +++ b/core/img/filetypes/text-calendar.svg diff --git a/core/js/config.php b/core/js/config.php index b6875fb73f9..139c3b6d485 100644 --- a/core/js/config.php +++ b/core/js/config.php @@ -24,6 +24,7 @@ foreach(OC_App::getEnabledApps() as $app) { $array = array( "oc_debug" => (defined('DEBUG') && DEBUG) ? 'true' : 'false', + "oc_isadmin" => OC_User::isAdminUser(OC_User::getUser()) ? 'true' : 'false', "oc_webroot" => "\"".OC::$WEBROOT."\"", "oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution "datepickerFormatDate" => json_encode($l->l('jsdate', 'jsdate')), diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 6a96b17b100..91157b923a5 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -36,7 +36,7 @@ <body id="body-login"> <div class="wrapper"><!-- for sticky footer --> <header><div id="header"> - <img src="<?php print_unescaped(image_path('', 'logo.svg')); ?>" class="svg" alt="<?php p($theme->getName()); ?>" /> + <div class='logo'></div> <div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div> </div></header> diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 9e1555cfe6d..3d897503480 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -45,8 +45,9 @@ <?php endif; ?> </div> <header><div id="header"> - <a href="<?php print_unescaped(link_to('', 'index.php')); ?>" title="" id="owncloud"><img class="svg" - src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="<?php p($theme->getName()); ?>" /></a> + <a href="<?php print_unescaped(link_to('', 'index.php')); ?>" title="" id="owncloud"> + <div class='logo-wide'></div> + </a> <div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div> <div id="settings" class="svg"> <span id="expand" tabindex="0" role="link"> |