2014-03-12 14:52:47 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
Jappix - An open social platform
|
|
|
|
This script (re)generates the store sub-folders (after an update)
|
|
|
|
|
|
|
|
-------------------------------------------------
|
|
|
|
|
|
|
|
License: AGPL
|
|
|
|
Authors: Valérian Saliou, regilero
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Someone is trying to hack us?
|
|
|
|
if(!defined('JAPPIX_BASE')) {
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Array of the sub-folders to create
|
|
|
|
$store_folders = array(
|
|
|
|
'access',
|
|
|
|
'backgrounds',
|
|
|
|
'conf',
|
|
|
|
'logos',
|
|
|
|
'music',
|
|
|
|
'share',
|
|
|
|
'update'
|
|
|
|
);
|
|
|
|
|
|
|
|
// Creates the store sub-folders
|
|
|
|
for($i = 0; $i < count($store_folders); $i++) {
|
|
|
|
$current = JAPPIX_BASE.'/store/'.$store_folders[$i];
|
2014-11-25 23:42:38 +01:00
|
|
|
|
2014-03-12 14:52:47 +01:00
|
|
|
// Create the folder itself
|
|
|
|
if(!is_dir($current)) {
|
|
|
|
mkdir($current, 0777, true);
|
|
|
|
}
|
2014-11-25 23:42:38 +01:00
|
|
|
|
2014-03-12 14:52:47 +01:00
|
|
|
chmod($current, 0777);
|
2014-11-25 23:42:38 +01:00
|
|
|
|
2014-03-12 14:52:47 +01:00
|
|
|
// Create the security file inside the folder
|
|
|
|
$security_html = securityHTML();
|
2014-11-25 23:42:38 +01:00
|
|
|
|
2014-03-12 14:52:47 +01:00
|
|
|
file_put_contents($current.'/index.html', $security_html, LOCK_EX);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Apply 777 rights on other writable folders
|
|
|
|
chmod(JAPPIX_BASE.'/log', 0777);
|
|
|
|
chmod(JAPPIX_BASE.'/tmp', 0777);
|
|
|
|
|
|
|
|
?>
|