Guest ThePaulius Posted May 24, 2005 Share Posted May 24, 2005 Hi, every time i change something i get this: Try changing the CHMOD value to 0777. Remember to set it back to 0644 afterwards! Fair enough, i like the security BUT is there some kind of way to automatically CHMOD 777 and then back to 644 when you click "update" its a real pain having to do this all the time... p.s. fantasic script lads! i will be buying this no doubt.. ;) Quote Link to comment Share on other sites More sharing options...
Guest Posted May 25, 2005 Share Posted May 25, 2005 For your convenience, I have set out a patch below for cc3 beta ONLY. You will have to enter your server ftp details each time in order for it to work, but it saves having to load a seperate ftp client each time. Before you ask, these settings (well the password anyway) should never be stored on the server. Additionally, it may be a good idea that you set up a seperate ftp account through your control panel with only the priviledge on this folder to minimise any security risk of entering your ftp details for your entire site would have. USE AT YOUR OWN RISK in admin/settings/index.php Near the top of the file, insert the code in red if(isset($_POST['config'])){ include("../../includes/global.inc.php"); // attempt auto ftp? if($ftpauto=="Y") { $conn_id = ftp_connect($ftpserver); if ($conn_id) { $login_result = ftp_login($conn_id, $ftpuser, $ftppass); $command = "chmod 777 $ftppath/includes/global.inc.php"; $res = ftp_site($conn_id, $command); ftp_close($conn_id); } } $msg = writeConf($_POST['config'],$GLOBALS['rootDir']."/includes/global.inc.php", $config, "config"); // attempt auto ftp? if($ftpauto=="Y") { $conn_id = ftp_connect($ftpserver); if ($conn_id) { $login_result = ftp_login($conn_id, $ftpuser, $ftppass); $command = "chmod 644 $ftppath/includes/global.inc.php"; $res = ftp_site($conn_id, $command); ftp_close($conn_id); } } } towards the bottom of the file, insert the code in red <tr> <td width="30%" class="tdText"> </td> <td align="left"> To set permissions automatically<br> AUTOFTP <input name="ftpauto" type="radio" value="N" <?php if($_POST['ftpauto']!="Y"){echo "checked";}?>>No <input name="ftpauto" type="radio" value="Y" <?php if($_POST['ftpauto']=="Y"){echo "checked";}?>>Yes<br> Server <input class="textbox" type="text" name="ftpserver" value="<?php echo $_POST['ftpserver'];?>"> eg. ftp.yourdomain.com<br> Path <input class="textbox" type="text" name="ftppath" value="<?php echo $_POST['ftppath'];?>"> eg. /public_html<br> User <input class="textbox" type="text" name="ftpuser" value="<?php echo $_POST['ftpuser'];?>"><br> password <input class="textbox" type="password" name="ftppass" value="<?php echo $_POST['ftppass'];?>"><br> <input name="submit" type="submit" class="submit" id="submit" value="<?php echo $lang['admin']['settings']['update_settings'];?>" /></td> </tr> </table> </form> <?php include("../includes/footer.inc.php"); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.