SHARE
TWEET

Untitled

a guest Jun 17th, 2014 234 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. function MY_PROFILE_install_tasks($install_state) {
  4.   $tasks['MY_PROFILE_create_private_dir'] = array(
  5.     'type' => 'normal',
  6.     'run' => INSTALL_TASK_RUN_IF_REACHED,
  7.   );
  8.  
  9.   return $tasks;
  10. }
  11.  
  12. function MY_PROFILE_create_private_dir() {
  13.   // THIS IS NOT SAFE AND SHOULD BE CHANGED LATER ON MANUALLY FROM ADMIN!
  14.   $private_directory = 'sites/default/files/private';
  15.   // Create the folder.
  16.   drupal_mkdir($private_directory, NULL, TRUE);
  17.   drupal_chmod($private_directory);
  18.   // Private filesystem.
  19.   variable_set('file_private_path', $private_directory);
  20.   file_create_htaccess($private_directory);
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top