Jump to content

Updating


Guest ThePaulius

Recommended Posts

Guest ThePaulius

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..

;)

Link to comment
Share on other sites

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">&nbsp;</td>

<td align="left">

To set permissions automatically<br>

AUTOFTP&nbsp;<input name="ftpauto" type="radio" value="N" <?php if($_POST['ftpauto']!="Y"){echo "checked";}?>>No&nbsp;<input name="ftpauto" type="radio" value="Y" <?php if($_POST['ftpauto']=="Y"){echo "checked";}?>>Yes<br>

Server&nbsp;<input class="textbox" type="text" name="ftpserver" value="<?php echo $_POST['ftpserver'];?>">&nbsp;eg. ftp.yourdomain.com<br>

Path&nbsp;<input class="textbox" type="text" name="ftppath" value="<?php echo $_POST['ftppath'];?>">&nbsp;eg. /public_html<br>

User&nbsp;<input class="textbox" type="text" name="ftpuser" value="<?php echo $_POST['ftpuser'];?>"><br>

password&nbsp;<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"); ?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...