diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/command/maintenance/install.php | 5 | ||||
-rw-r--r-- | core/js/js.js | 32 |
2 files changed, 35 insertions, 2 deletions
diff --git a/core/command/maintenance/install.php b/core/command/maintenance/install.php index 2fea5add438..7f5d9cae647 100644 --- a/core/command/maintenance/install.php +++ b/core/command/maintenance/install.php @@ -61,7 +61,10 @@ class Install extends Command { protected function execute(InputInterface $input, OutputInterface $output) { // validate the environment - $setupHelper = new Setup($this->config, \OC::$server->getIniWrapper(), \OC::$server->getL10N('lib'), new \OC_Defaults()); + $server = \OC::$server; + $setupHelper = new Setup($this->config, $server->getIniWrapper(), + $server->getL10N('lib'), new \OC_Defaults(), $server->getLogger(), + $server->getSecureRandom()); $sysInfo = $setupHelper->getSystemInfo(true); $errors = $sysInfo['errors']; if (count($errors) > 0) { diff --git a/core/js/js.js b/core/js/js.js index 8380d56e31e..45c9c90362f 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1609,8 +1609,38 @@ OC.Util = { } } return aa.length - bb.length; + }, + /** + * Calls the callback in a given interval until it returns true + * @param {function} callback + * @param {integer} interval in milliseconds + */ + waitFor: function(callback, interval) { + var internalCallback = function() { + if(callback() !== true) { + setTimeout(internalCallback, interval); + } + }; + + internalCallback(); + }, + /** + * Checks if a cookie with the given name is present and is set to the provided value. + * @param {string} name name of the cookie + * @param {string} value value of the cookie + * @return {boolean} true if the cookie with the given name has the given value + */ + isCookieSetToValue: function(name, value) { + var cookies = document.cookie.split(';'); + for (var i=0; i < cookies.length; i++) { + var cookie = cookies[i].split('='); + if (cookie[0].trim() === name && cookie[1].trim() === value) { + return true; + } + } + return false; } -} +}; /** * Utility class for the history API, |