Commit 7ac98a6d7a1be450be7cd893a41e124c41616894
1 parent
ff6f286e
Exists in
master
and in
7 other branches
Opções adicionais para criação de pastas e alteração de permissão em SO Linux
Showing
1 changed file
with
54 additions
and
1 deletions
Show diff stats
testainstal.php
@@ -60,7 +60,18 @@ if($i3geomaster[0]["usuario"] == "admin" && $i3geomaster[0]["senha"] == "admin" | @@ -60,7 +60,18 @@ if($i3geomaster[0]["usuario"] == "admin" && $i3geomaster[0]["senha"] == "admin" | ||
60 | } | 60 | } |
61 | 61 | ||
62 | if(empty($_POST["senha"]) || empty($_POST["usuario"])){ | 62 | if(empty($_POST["senha"]) || empty($_POST["usuario"])){ |
63 | - formularioLoginMaster("testainstal.php"); | 63 | + formularioLoginMaster("testainstal.php"); |
64 | + //opcoes de criacao de pastas | ||
65 | + if (strtoupper(substr(PHP_OS, 0, 3) != 'WIN')){ | ||
66 | + echo "<script>"; | ||
67 | + echo "var f = document.getElementById('formularioLoginMaster');"; | ||
68 | + echo "var ins = '<br><br><input type=checkbox name=criaPastaMstmp unchecked /> Cria a pasta /tmp/ms_tmp<br><br>';"; | ||
69 | + echo "ins += '<input type=checkbox name=criaLink unchecked /> Cria o link simbolico /var/www/ms_tmp<br><br>';"; | ||
70 | + echo "ins += '<input type=checkbox name=permPastaI3geo unchecked /> Altera as permissoes da pasta /var/www/i3geo<br>';"; | ||
71 | + echo "f.innerHTML += ins;"; | ||
72 | + | ||
73 | + echo "</script>"; | ||
74 | + } | ||
64 | exit; | 75 | exit; |
65 | } | 76 | } |
66 | else{ | 77 | else{ |
@@ -100,6 +111,48 @@ echo "---<br>"; | @@ -100,6 +111,48 @@ echo "---<br>"; | ||
100 | if (get_cfg_var("safe_mode") == 1){ | 111 | if (get_cfg_var("safe_mode") == 1){ |
101 | echo "<span style=color:red >Problema: safe_mode no php.ini deveria estar como 'Off'. O i3Geo não irá funcionar!!!<br></span>"; | 112 | echo "<span style=color:red >Problema: safe_mode no php.ini deveria estar como 'Off'. O i3Geo não irá funcionar!!!<br></span>"; |
102 | } | 113 | } |
114 | + | ||
115 | +//executa as opcoes linux definidas no formulario | ||
116 | +if($_POST["criaPastaMstmp"] == "on"){ | ||
117 | + echo "<br>Criando a pasta /tmp/ms_tmp\n"; | ||
118 | + if(!file_exists("/tmp/ms_tmp")){ | ||
119 | + @mkdir ("/tmp/ms_tmp",0777); | ||
120 | + } | ||
121 | + else{ | ||
122 | + chmod("/tmp/ms_tmp",0777); | ||
123 | + } | ||
124 | + if(!file_exists("/tmp/ms_tmp")){ | ||
125 | + echo "<span style=color:red >Arquivo /tmp/ms_tmp não pode ser criado\n"; | ||
126 | + } | ||
127 | + else{ | ||
128 | + echo "...OK\n"; | ||
129 | + } | ||
130 | +} | ||
131 | +if($_POST["criaLink"] == "on"){ | ||
132 | + echo "<br>Criando o link simbólico /var/www/ms_tmp\n"; | ||
133 | + if(!file_exists("/var/www/ms_tmp")){ | ||
134 | + @symlink("/tmp/ms_tmp","/var/www/ms_tmp"); | ||
135 | + } | ||
136 | + else{ | ||
137 | + chmod("/var/www/ms_tmp",0777); | ||
138 | + } | ||
139 | + if(!file_exists("/var/www/ms_tmp")){ | ||
140 | + echo "<span style=color:red >Link /var/www/ms_tmp não pode ser criado\n"; | ||
141 | + } | ||
142 | + else{ | ||
143 | + echo "...OK\n"; | ||
144 | + } | ||
145 | +} | ||
146 | +if($_POST["permPastaI3geo"] == "on"){ | ||
147 | + echo "<br>Alterando permissões /var/www/i3geo i3geo/temas i3geo/admin i3geo/admin/admin.db\n"; | ||
148 | + if(!file_exists("/var/www/i3geo")){ | ||
149 | + chmod("/var/www/i3geo",0777); | ||
150 | + chmod("/var/www/i3geo/temas",0777); | ||
151 | + chmod("/var/www/i3geo/admin",0777); | ||
152 | + chmod("/var/www/i3geo/admin/admin.db",0777); | ||
153 | + echo "...OK\n"; | ||
154 | + } | ||
155 | +} | ||
103 | echo "<br><pre>Extensões:<br>"; | 156 | echo "<br><pre>Extensões:<br>"; |
104 | if (!extension_loaded("curl")){ | 157 | if (!extension_loaded("curl")){ |
105 | echo "<span style=color:red >Problema: não está instalado a curl que pode afetar algumas funcionalidades do i3Geo<br></span>"; | 158 | echo "<span style=color:red >Problema: não está instalado a curl que pode afetar algumas funcionalidades do i3Geo<br></span>"; |