summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xapps.installer.inc2
-rwxr-xr-xapps.module11
-rwxr-xr-xapps.profile.inc6
3 files changed, 17 insertions, 2 deletions
diff --git a/apps.installer.inc b/apps.installer.inc
index 4ba4405..85a25ec 100755
--- a/apps.installer.inc
+++ b/apps.installer.inc
@@ -187,7 +187,7 @@ function apps_install_downloads() {
// credentials. Instead, we instantiate a FileTransferLocal and invoke
// update_authorize_run_update() directly.
//if (fileowner($project_real_location) == fileowner(conf_path())) {
- if (is_writeable(conf_path())) {
+ if (apps_installer_has_write_access()) {
module_load_include('inc', 'update', 'update.authorize');
$filetransfer = new FileTransferLocal(DRUPAL_ROOT);
apps_run_install($filetransfer, $updates); //this is our change
diff --git a/apps.module b/apps.module
index 056a82a..b7714b3 100755
--- a/apps.module
+++ b/apps.module
@@ -79,6 +79,17 @@ function apps_hook_info() {
}
/**
+ * Check whether Apps has write access to libraries and modules directories.
+ *
+ * @return boolean
+ */
+function apps_installer_has_write_access() {
+ $libraries_dir = (is_dir('sites/all/libraries')) ? 'sites/all/libraries' : 'sites/all';
+ return is_writable(drupal_realpath($libraries_dir)) && is_writable(drupal_realpath('sites/all/modules'));
+}
+
+
+/**
* Implements hook_block_info().
*/
function apps_block_info() {
diff --git a/apps.profile.inc b/apps.profile.inc
index e9ece1c..ea973ff 100755
--- a/apps.profile.inc
+++ b/apps.profile.inc
@@ -11,6 +11,10 @@
*
*/
function apps_profile_install_tasks($install_state, $apps_server) {
+ // Need to include the apps.module file because on installs the profile
+ // collects all install tasks before any modules are enabled
+ module_load_include('module', 'apps');
+
// Only use apps forms during interactive installs.
$tasks = array();
if ($install_state['interactive']) {
@@ -34,7 +38,7 @@ function apps_profile_install_tasks($install_state, $apps_server) {
'apps_profile_authorize_transfer_' . $apps_server_name => array(
'display' => FALSE,
'type' => 'form',
- 'run' => (!is_writeable(conf_path()) && isset($_SESSION['apps']))?INSTALL_TASK_RUN_IF_NOT_COMPLETED:INSTALL_TASK_SKIP,
+ 'run' => (!apps_installer_has_write_access() && isset($_SESSION['apps']))?INSTALL_TASK_RUN_IF_NOT_COMPLETED:INSTALL_TASK_SKIP,
'function' => 'apps_profile_authorize_transfer',
),
'apps_profile_install_app_modules_' . $apps_server_name => array(