Game Control Panel Help PLEASE!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
AIOHosting
Forum Newbie
Posts: 4
Joined: Sat Jan 08, 2005 6:05 pm

Game Control Panel Help PLEASE!

Post by AIOHosting »

Ok First Off, Thank you for looking:

I am trying to make a Admin-side to my Control Panel. (Im making a Game Server Control Panel)
My Goals:
> Install Game Servers via Web.
> Remove Game Servers via Web.
> Start/Stop Game Servers via Web.
> Manage Game Servers (Change server passwords, change settings, etc.)
> Change Server Mods (change from amx to amxx etc.)
I have a General Idea on everything that i want done. I have a General Idea on how to do things. I found some help from http://www.php.net but if anyone in here could help me i would GREATLY appreciate it. I would also reward the people that help me :)

What i need done is:
Someone to Help me code the Back end to my script. I need someone to help me make a Pipe (or w/e it is to connect to a remote machine) i have 1 command that requires a pipe. (FOUND HERE: http://lists.freebsd.org/pipermail/free ... 11018.html) I need someone that will basically help me start coding the part of the script that Connects and if it fails to connect it tell you. If the connection is terminated it would need to display a notice saying connection was terminated.

http://allinonehosting.net/gamecp/admin/admin.php

Thats what the install page will look like (it will under go a few modifications once i can get the script to beable to talk to the remote machine.

Please Help Me If You Can.

Thank You,
Robert Maltby

If you help me i will reward you (depending on how much / well you help me)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You appear to be asking for voluntary help with your project, instead of helping you learn how to make such a system. Is this true?
AIOHosting
Forum Newbie
Posts: 4
Joined: Sat Jan 08, 2005 6:05 pm

Post by AIOHosting »

No, I am asking for someone to help me code it -- So i can learn how to do it my self.

i have gathered quite a few commands but.. i dont know what all does what...

Code: Select all

<?php
/*
 Notify the user if the server terminates the connection 
*/
function my_ssh_disconnect($reason, $message, $language) &#123;
  printf("Server disconnected with reason code &#1111;%d] and message: %s\n",
         $reason, $message);
&#125;

$methods = array(
  'kex' => 'diffie-hellman-group1-sha1',
  'client_to_server' => array(
   'crypt' => '3des-cbc',
   'comp' => 'none'),
  'server_to_client' => array(
   'crypt' => 'aes256-cbc,aes192-cbc,aes128-cbc',
   'comp' => 'none'));

$callbacks = array('disconnect' => 'my_ssh_disconnect');

$connection = ssh2_connect('$hostname_from_drop_down', 22, $methods, $callbacks);
if (!$connect) die('Connection failed');
if (ssh2_auth_password($connection, 'root', '$remote_machine_root_password')) &#123;
  echo "Authentication Successful!\n";
&#125; else &#123;
  die('Authentication Failed...');
&#125;

//Fingerprint To the Remote Machine
$known_host = '6F89C2F0A719B30CC38ABDF90755F2E4';

$connection = ssh2_connect('$hostname_from_drop_down', 22);
if (ssh2_auth_password($connection, 'root', '$remote_machine_root_password')) &#123;
  echo "Authentication Successful!\n";
&#125; else &#123;
  die('Authentication Failed...');
&#125;
$fingerprint = ssh2_fingerprint($connection,
               SSH2_FINGERPRINT_MD5 | SSH2_FINGERPRINT_HEX);

if ($fingerprint != $known_host) &#123;
  die("HOSTKEY MISMATCH!\n" .
     "Possible Man-In-The-Middle Attack?");
&#125;


?> 

$stream = ssh2_exec($connection, 'PUT SSH COMMANDS IN HERE!!');
the $stream = ssh2_exec($connection, 'PUT SSH COMMANDS IN HERE!!');
i know will allow me send commands to the machine. but i need some help as to which way would be the safest -- best way to connect to it.

I am willing to either A) Pay someone to Help me or B) Give someone some Services from AIOHosting -- http://www.allinonehosting.net or C) give someone a certain percentage of the sales that this script brings in

Thanks,
Robert Maltby
AIOHosting
Forum Newbie
Posts: 4
Joined: Sat Jan 08, 2005 6:05 pm

Post by AIOHosting »

Can someone Give me an Example of a Fopen script that will let me conect and talk to a remote linux machine..

Thank You.
ianlandsman
Forum Newbie
Posts: 24
Joined: Thu Dec 30, 2004 9:50 pm
Location: New York

Post by ianlandsman »

So you know, the ssh functions you are using are only available in the CVS (development) version of PHP. So if your running your script on a shared hosting server it most likely the case that these functions are not available for you to use.

http://us3.php.net/manual/en/ref.ssh2.php
AIOHosting
Forum Newbie
Posts: 4
Joined: Sat Jan 08, 2005 6:05 pm

Post by AIOHosting »

Yea, i printed every one of those pages out.. ( :lol: )
Im still trying to get some more info on this.. My friend jcart helped me make a script / function that will connect to the machine.. but im still working on some others..

Thanks for the link :)

Robert
Post Reply