Jump to content
MakeWebGames

Yet another... odd idea... for the yet even more lazy people


Yet another... odd idea... for the yet even more lazy people  

16 members have voted

  1. 1. Yet another... odd idea... for the yet even more lazy people

    • Yes I like it!
      7
    • Could be an option but not all that useful
      1
    • I would never use it
      3
    • Don't you have something more interesting to work on?
      5


Recommended Posts

Posted

I was wonder, what if you could ask the nw-engine.com to upload directly the free or a paid version of the engine to your own website? So you would provide your site name, username & password, and a directory where it should go. Then the site will act as an FTP client and upload the script for you directly on the right place.

That could help people to install it, without having first to download and then upload it back to some server. Maybe I'm going way too far on the lazy road... but I thought I shall share my madness with you :p

Posted

It's not because the others don't do it for free that I cannot ;)

Think about the first time you saw free hosting or free hotspots. Maybe you thought those guys are stupid... yet you find those more and more.

BTW it's not a manual process. I will NOT upload the files for you for free... Simply write some scripts which do it. So you will simply use the service but not a human powered one. I'm not totally masochist either! So if there is a script which does it, why shall I make it pay?

Posted

Yeah i kinda figured it would be automated however is it getting beyond lazy?

Also there is people here that dont even know what FTP is or how to create a FTP account as they use file uploading from their control panel.

Posted

I've seen such a system on sucuri.net and a couple other web app's.

You purchase their product, you either download or provide an FTP username/password and directory, it will set it up and install it for the client. So yes, defiantly an approach ahead.

Posted

You've already got the self extracting part down (I think I recall seeing this previously), so I doubt it'd be worth putting in the effort to do this.

Like Ruler said, most people just upload using the file manager of cPanel (or whatever panel used), in which uploading what you need couldn't be easier (nor is it difficult within a ftp program or however you decided to upload files).

Therefore if you did do it, I doubt many if any would actually use this feature.

Regardless, it's a neat idea.

Posted (edited)
It's quite overkill.

Also, do you really want to be liable for actions on other people's servers?

How is it overkill?

It's a better feature for your client's to get their game setup easier for them.

The below script took me a mere 8 - 14 minute's to write, and IT WAS NOT TESTED, but there should not be much error's and anyone would be able to fix them.

As Alain already has the extractor script.

 

<?php

$user = 'username';			# FTP Username
$pass = 'password';			# FTP Password
$host = 'ftp.domain.com';	# FTP Host
$dir  = '/directory';		# FTP Directory
$dmn  = 'http://domain.com';# Client Domain

$local_file['engine'] = 'engine.zip';
$local_file['extractor'] = 'extract.php';

# If we can create a connection, continue.
if($con = ftp_connect($host))	{

# Created connection!
# Now we see if we can login successfully
if(ftp_login($con, $user, $pass))	{

	# Logged in.
	# Check the directory.
	if(ftp_chdir($con, '/public_html'.$dir)) {

		# Directory Exists.
		# Place the files.
		if(ftp_put($con, $local_file['engine']) || ftp_put($con, $local_file['extractor']))	{

			# Files placed. Hit the extractor.
			$curl = curl_init($dmn.$dir.'/extract.php');
			curl_setopt($curl, CURLOPT_HEADER, 0);
			curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
			$return = curl_exec($curl);
			curl_close($curl);

			/* Can check the $return value for an php error notice or the such here. */
			echo 'File uploaded & extracted.';

		}	else	{

			# A file failed to upload.
			echo 'One of the file\'s failed to upload.';

		}	

	}	else	{

		# Directory doesnt exist. Make it.
		if(ftp_mkdir($con, '/public_html'.$dir))	{

			# Directory Created.
			# Place the files.
			if(ftp_put($con, $local_file['engine']) || ftp_put($con, $local_file['extractor']))	{

				# Files placed. Hit the extractor.
				$curl = curl_init($dmn.$dir.'/extract.php');
				curl_setopt($curl, CURLOPT_HEADER, 0);
				curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
				$return = curl_exec($curl);
				curl_close($curl);

				/* Can check the $return value for an php error notice or the such here. */
				echo 'File uploaded & extracted.';

			}	else	{

				# A file failed to upload.
				echo 'One of the file\'s failed to upload.';

			}	

		}	else	{

			# Failed to make directory.
			echo 'Failed to make directory. Please reassure you have enough permisions.';

		}

	}

	# Close FTP Connection
	ftp_close($con);

}	else	{

	# Issue with login in.
	echo 'Login failed. Check login details.';

}

}	else	{

# Connection to host failed.
echo 'Connecting to host failed.';

}

?>
Edited by HauntedDawg
Posted
How is it overkill?

It's a better feature for your client's to get their game setup easier for them.

The below script took me a mere 8 - 14 minute's to write, and IT WAS NOT TESTED, but there should not be much error's and anyone would be able to fix them.

As Alain already has the extractor script.

 

<?php

$user = 'username';            # FTP Username
$pass = 'password';            # FTP Password
$host = 'ftp.domain.com';    # FTP Host
$dir  = '/directory';        # FTP Directory
$dmn  = 'http://domain.com';# Client Domain

$local_file['engine'] = 'engine.zip';
$local_file['extractor'] = 'extract.php';

# If we can create a connection, continue.
if($con = ftp_connect($host))    {

   # Created connection!
   # Now we see if we can login successfully
   if(ftp_login($con, $user, $pass))    {

       # Logged in.
       # Check the directory.
       if(ftp_chdir($con, '/public_html'.$dir)) {

           # Directory Exists.
           # Place the files.
           if(ftp_put($con, $local_file['engine']) || ftp_put($con, $local_file['extractor']))    {

               # Files placed. Hit the extractor.
               $curl = curl_init($dmn.$dir.'/extract.php');
               curl_setopt($curl, CURLOPT_HEADER, 0);
               curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
               $return = curl_exec($curl);
               curl_close($curl);

               /* Can check the $return value for an php error notice or the such here. */
               echo 'File uploaded & extracted.';

           }    else    {

               # A file failed to upload.
               echo 'One of the file\'s failed to upload.';

           }    

       }    else    {

           # Directory doesnt exist. Make it.
           if(ftp_mkdir($con, '/public_html'.$dir))    {

               # Directory Created.
               # Place the files.
               if(ftp_put($con, $local_file['engine']) || ftp_put($con, $local_file['extractor']))    {

                   # Files placed. Hit the extractor.
                   $curl = curl_init($dmn.$dir.'/extract.php');
                   curl_setopt($curl, CURLOPT_HEADER, 0);
                   curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
                   $return = curl_exec($curl);
                   curl_close($curl);

                   /* Can check the $return value for an php error notice or the such here. */
                   echo 'File uploaded & extracted.';

               }    else    {

                   # A file failed to upload.
                   echo 'One of the file\'s failed to upload.';

               }    

           }    else    {

               # Failed to make directory.
               echo 'Failed to make directory. Please reassure you have enough permisions.';

           }

       }

       # Close FTP Connection
       ftp_close($con);

   }    else    {

       # Issue with login in.
       echo 'Login failed. Check login details.';

   }

}    else    {

   # Connection to host failed.
   echo 'Connecting to host failed.';

}

?>

Dude, that's like saying "screw you" in the face of your clients.

Plaintext authentication is really, really bad.

Posted
Well FTP is not really the safest protocol in my book unless use use sftp ;)

Yea, but what about people on a shared hosting plan? I doubt they have unrestricted access to their SSH daemon.

Posted

@ Spud: That was merely an example, dude. If anyone used that for their client's, their first mistake would be they are storing those ftp detail's in the DB as raw data. While on the other hand, you can create your own crypt function to crypt them, and to decrypt them.

Posted
@ Spud: That was merely an example, dude. If anyone used that for their client's, their first mistake would be they are storing those ftp detail's in the DB as raw data. While on the other hand, you can create your own crypt function to crypt them, and to decrypt them.

This sounds like a scamming scheme - why on earth would you store these credentials?

Posted

Why do you keep looking at it as a perspective to store those detail's? You can make it a once off transaction, user input's their username & password & directory, it does not store it, you hit go and it does it for you.

Beanstalkapp.com use's it, and i know of 8+- people who use their built in deployment.

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