Anope IRC Services

Anope Support => 2.0.x/1.9.x Support => Topic started by: Borja on January 30, 2014, 09:30:34 PM

Title: Register channel from web service
Post by: Borja on January 30, 2014, 09:30:34 PM
Hello,

I have a Drupal site.

I am using m_sql_authentication module and db_sql_live and everything works fine.

I want to make a form in drupal where a user can create a channel. I need to send the command to create channel from php.


I am using 2.0.x release.

How I can do this?

Thanks.

Title: Re: Register channel from web service
Post by: Kugener Jeff on January 30, 2014, 11:03:09 PM
I think you can try it like this;

Code: [Select]

if( $_POST['create'] == "channel" ) {

$nickname = $_POST['nickname'];
$channel = $_POST['channel'];
$password = $_POST['password'];
$descr = $_POST['descr'];

$chksum = md5("CHAN_REG:".$_POST["nickname"]." ".$_POST["channel"]." ".$_POST["password"]." ".$_POST["descr"].":".time().":supernova");
$cmd     = "CHAN_REG";
$sqlcmd_checksum_salt = "supernova";
$params = "$nickname $channel $password $descr";
$tstamp = time();
 
$sql = "INSERT INTO database (cmd, params, tstamp, chksum, status) VALUES('$cmd','$nickname $channel $password $descr', '$tstamp', '$chksum', '0')";
.....
}
Title: Re: Register channel from web service
Post by: Xabier on January 31, 2014, 07:51:03 AM
I have the same problem

How is table name? I don't view any table with this structure?

Can help me? thanks
Title: Re: Register channel from web service
Post by: Adam on January 31, 2014, 08:30:16 AM
Just insert the new channel into the channel table..