diff --git a/web/concrete/composer.lock b/web/concrete/composer.lock index 2917b8e9026..9d723a83a3a 100644 --- a/web/concrete/composer.lock +++ b/web/concrete/composer.lock @@ -1,77 +1,49 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" ], - "hash": "ec8eb5b395fdc71d6690c8f7cff1679d", + "hash": "3ce5938d1bf3fc26c3d83ce38c22bd1b", "packages": [ { - "name": "aws/aws-sdk-php", - "version": "2.6.6", + "name": "anahkiasen/html-object", + "version": "1.4.0", "source": { "type": "git", - "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "37d5572e2408c5ea7104c361b64a187b1a0a53bd" + "url": "https://github.com/Anahkiasen/html-object.git", + "reference": "776aff25a4db27964d95b2332e2f379b0aac9ff0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/37d5572e2408c5ea7104c361b64a187b1a0a53bd", - "reference": "37d5572e2408c5ea7104c361b64a187b1a0a53bd", + "url": "https://api.github.com/repos/Anahkiasen/html-object/zipball/776aff25a4db27964d95b2332e2f379b0aac9ff0", + "reference": "776aff25a4db27964d95b2332e2f379b0aac9ff0", "shasum": "" }, "require": { - "guzzle/guzzle": ">=3.7.0,<=3.9.9", - "php": ">=5.3.3" - }, - "require-dev": { - "doctrine/cache": "~1.0", - "ext-openssl": "*", - "monolog/monolog": "1.4.*", - "phpunit/phpunit": "3.7.*", - "symfony/class-loader": "2.*", - "symfony/yaml": "2.*" - }, - "suggest": { - "doctrine/cache": "Adds support for caching of credentials and responses", - "ext-apc": "Allows service description opcode caching, request and response caching, and credentials caching", - "ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages", - "monolog/monolog": "Adds support for logging HTTP requests and responses", - "symfony/yaml": "Eases the ability to write manifests for creating jobs in AWS Import/Export" + "php": ">=5.3.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6.x-dev" - } - }, "autoload": { "psr-0": { - "Aws": "src/" - } + "HtmlObject": "src" + }, + "classmap": [ + "tests" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache-2.0" + "MIT" ], "authors": [ { - "name": "Amazon Web Services", - "homepage": "http://aws.amazon.com" + "name": "Maxime Fabre", + "email": "ehtnam6@gmail.com" } ], - "description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project", - "homepage": "http://aws.amazon.com/sdkforphp", - "keywords": [ - "amazon", - "aws", - "cloud", - "dynamodb", - "ec2", - "glacier", - "s3", - "sdk" - ], - "time": "2014-05-29 18:57:57" + "description": "A set of classes to create and manipulate HTML objects abstractions", + "time": "2014-01-27 22:41:20" }, { "name": "dapphp/securimage", @@ -229,7 +201,7 @@ ], "authors": [ { - "name": "Jonathan Wage", + "name": "Jonathan H. Wage", "email": "jonwage@gmail.com", "homepage": "http://www.jwage.com/", "role": "Creator" @@ -391,7 +363,7 @@ "email": "kontakt@beberlei.de" }, { - "name": "Johannes M. Schmitt", + "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com", "homepage": "http://jmsyst.com", "role": "Developer of wrapped JMSSerializerBundle" @@ -1718,17 +1690,17 @@ }, { "name": "symfony/class-loader", - "version": "dev-master", + "version": "2.5.x-dev", "target-dir": "Symfony/Component/ClassLoader", "source": { "type": "git", "url": "https://github.com/symfony/ClassLoader.git", - "reference": "206de04f06299f28e1725d9a07a2ee05610fb6f8" + "reference": "25b74b67d455268415d7d34b41f8b7df4cb33ba4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/206de04f06299f28e1725d9a07a2ee05610fb6f8", - "reference": "206de04f06299f28e1725d9a07a2ee05610fb6f8", + "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/25b74b67d455268415d7d34b41f8b7df4cb33ba4", + "reference": "25b74b67d455268415d7d34b41f8b7df4cb33ba4", "shasum": "" }, "require": { @@ -1740,7 +1712,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -1766,7 +1738,7 @@ ], "description": "Symfony ClassLoader Component", "homepage": "http://symfony.com", - "time": "2014-07-09 09:06:26" + "time": "2014-07-09 09:05:48" }, { "name": "symfony/console", @@ -2089,12 +2061,12 @@ "version": "v0.5.2", "source": { "type": "git", - "url": "https://github.com/tedivm/JShrink.git", + "url": "https://github.com/tedious/JShrink.git", "reference": "4b48e3d051cf0ab145db9df20d3292d91485bb60" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tedivm/JShrink/zipball/4b48e3d051cf0ab145db9df20d3292d91485bb60", + "url": "https://api.github.com/repos/tedious/JShrink/zipball/4b48e3d051cf0ab145db9df20d3292d91485bb60", "reference": "4b48e3d051cf0ab145db9df20d3292d91485bb60", "shasum": "" }, @@ -2743,6 +2715,7 @@ "zf1/zend-mail": 20, "nesbot/carbon": 20 }, + "prefer-stable": false, "platform": { "php": ">=5.3.3" }, diff --git a/web/concrete/controllers/single_page/dashboard/system/basics/icons.php b/web/concrete/controllers/single_page/dashboard/system/basics/icons.php index e4b84a01b6d..b53fa81e166 100644 --- a/web/concrete/controllers/single_page/dashboard/system/basics/icons.php +++ b/web/concrete/controllers/single_page/dashboard/system/basics/icons.php @@ -1,75 +1,66 @@ set('site', SITE); - } + public function on_start() { + parent::on_start(); + $view = View::getInstance(); + $view->requireAsset('core/colorpicker'); + } public function favicon_saved() { - $this->set('message', t("Icons updated successfully.")); - $this->view(); + $this->set('message', t("Icons updated successfully.")); } public function favicon_removed() { $this->set('message', t("Icon removed successfully.")); - $this->view(); } public function iphone_icon_saved() { $this->set('message', t("iPhone icon updated successfully.")); - $this->view(); } public function iphone_icon_removed() { $this->set('message', t("iPhone icon removed successfully.")); - $this->view(); } public function modern_icon_saved() { $this->set('message', t('Windows 8 icon updated successfully.')); - $this->view(); } public function modern_icon_removed() { $this->set('message', t('Windows 8 icon removed successfully.')); - $this->view(); } function update_modern_thumbnail() { if($this->token->validate('update_modern_thumbnail')) { - if(intval($this->post('remove_icon')) == 1) { - Config::save('MODERN_TILE_THUMBNAIL_FID', 0); - $this->redirect('/dashboard/system/basics/icons/', 'modern_icon_removed'); - } - else { - $fi = new FileImporter(); - $resp = $fi->import($_FILES['favicon_file']['tmp_name'], $_FILES['favicon_file']['name'], $fr); - if(!($resp instanceof FileVersion)) { - switch($resp) { - case FileImporter::E_FILE_INVALID_EXTENSION: - $this->error->add(t('Invalid file extension.')); - break; - case FileImporter::E_FILE_INVALID: - $this->error->add(t('Invalid file.')); - break; - } - } - else { - Config::save('MODERN_TILE_THUMBNAIL_FID', $resp->getFileID()); - Config::save('MODERN_TILE_THUMBNAIL_BGCOLOR', Loader::helper('security')->sanitizeString($this->post('favicon_bgcolor'))); - $this->redirect('/dashboard/system/basics/icons/', 'modern_icon_saved'); - } + $S = Core::make('helper/security'); + $modernThumbFID = $S->sanitizeInt($this->post('modernThumbFID')); + $modernThumbBG = $S->sanitizeString($this->post('modernThumbBG')); + $result = "modern_icon_saved"; + if($modernThumbFID) { + Config::save('MODERN_TILE_THUMBNAIL_FID', $modernThumbFID); + } else { + Config::save('MODERN_TILE_THUMBNAIL_FID', 0); + $result = 'modern_icon_removed'; } + + Config::save('MODERN_TILE_THUMBNAIL_BGCOLOR', $modernThumbBG); + + $this->redirect('/dashboard/system/basics/icons/', $result); } else { $this->set('error', array($this->token->getErrorMessage())); @@ -77,65 +68,37 @@ function update_modern_thumbnail() { } function update_iphone_thumbnail(){ - if ($this->token->validate("update_iphone_thumbnail")) { - - if(intval($this->post('remove_icon'))==1){ - Config::save('IPHONE_HOME_SCREEN_THUMBNAIL_FID',0); - $this->redirect('/dashboard/system/basics/icons/', 'iphone_icon_removed'); - } else { - $fi = new FileImporter(); - $resp = $fi->import($_FILES['favicon_file']['tmp_name'], $_FILES['favicon_file']['name'], $fr); - if (!($resp instanceof FileVersion)) { - switch($resp) { - case FileImporter::E_FILE_INVALID_EXTENSION: - $this->error->add(t('Invalid file extension.')); - break; - case FileImporter::E_FILE_INVALID: - $this->error->add(t('Invalid file.')); - break; - - } - } else { - - Config::save('IPHONE_HOME_SCREEN_THUMBNAIL_FID', $resp->getFileID()); - $this->redirect('/dashboard/system/basics/icons/', 'iphone_icon_saved'); - - } - } - - }else{ + if ($this->token->validate("update_iphone_thumbnail")) { + + $S = Core::make('helper/security'); + $faviconFID = $S->sanitizeInt($this->post('iosHomeFID')); + + if($faviconFID){ + Config::save('IPHONE_HOME_SCREEN_THUMBNAIL_FID', $faviconFID); + $this->redirect('/dashboard/system/basics/icons/', 'iphone_icon_saved'); + } else { + Config::save('IPHONE_HOME_SCREEN_THUMBNAIL_FID', 0); + $this->redirect('/dashboard/system/basics/icons/', 'iphone_icon_removed'); + } + + } else { $this->set('error', array($this->token->getErrorMessage())); } } function update_favicon(){ - if ($this->token->validate("update_favicon")) { - - if(intval($this->post('remove_favicon'))==1){ - Config::save('FAVICON_FID',0); - $this->redirect('/dashboard/system/basics/icons/', 'favicon_removed'); - } else { - $fi = new FileImporter(); - $resp = $fi->import($_FILES['favicon_file']['tmp_name'], $_FILES['favicon_file']['name'], $fr); - if (!($resp instanceof FileVersion)) { - switch($resp) { - case FileImporter::E_FILE_INVALID_EXTENSION: - $this->error->add(t('Invalid file extension.')); - break; - case FileImporter::E_FILE_INVALID: - $this->error->add(t('Invalid file.')); - break; - - } - } else { - - Config::save('FAVICON_FID', $resp->getFileID()); - $this->redirect('/dashboard/system/basics/icons/', 'favicon_saved'); - - } - } - - }else{ + if ($this->token->validate("update_favicon")) { + $S = Core::make('helper/security'); + $faviconFID = $S->sanitizeInt($this->post('faviconFID')); + + if($faviconFID) { + Config::save('FAVICON_FID', $faviconFID); + $this->redirect('/dashboard/system/basics/icons/', 'favicon_saved'); + } else { + Config::save('FAVICON_FID',0); + $this->redirect('/dashboard/system/basics/icons/', 'favicon_removed'); + } + } else { $this->set('error', array($this->token->getErrorMessage())); } } diff --git a/web/concrete/single_pages/dashboard/system/basics/icons.php b/web/concrete/single_pages/dashboard/system/basics/icons.php index 93933fec93a..54d82205956 100644 --- a/web/concrete/single_pages/dashboard/system/basics/icons.php +++ b/web/concrete/single_pages/dashboard/system/basics/icons.php @@ -1,4 +1,4 @@ - +
controller->token->output('update_favicon')?> @@ -6,12 +6,12 @@
- file('ccm-favicon-file', 'fID', t('Choose File'), $f);?> + file('ccm-favicon-file', 'faviconFID', t('Choose File'), $f);?>
@@ -28,12 +28,12 @@
- file('ccm-iphone-file', 'fID', t('Choose File'), $f);?> + file('ccm-iphone-file', 'iosHomeFID', t('Choose File'), $f);?>
@@ -51,18 +51,35 @@
- file('ccm-modern-file', 'fID', t('Choose File'), $f);?> + file('ccm-modern-file', 'modernThumbFID', t('Choose File'), $f);?>
- output('favicon_bgcolor', strval(Config::get('MODERN_TILE_THUMBNAIL_BGCOLOR'))); ?> - + + + +