Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Register channel from web service  (Read 4056 times)

0 Members and 1 Guest are viewing this topic.

Borja

  • Anope User
  • Offline Offline
  • Posts: 17
Register channel from web service
« 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.

Logged

Kugener Jeff

  • Anope User
  • Offline Offline
  • Posts: 19
Re: Register channel from web service
« Reply #1 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')";
.....
}
« Last Edit: January 30, 2014, 11:11:42 PM by Kugener Jeff »
Logged

Xabier

  • Anope User
  • Offline Offline
  • Posts: 13
Re: Register channel from web service
« Reply #2 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
Logged

Adam

  • Team
  • *
  • Offline Offline
  • Posts: 463
Re: Register channel from web service
« Reply #3 on: January 31, 2014, 08:30:16 AM »

Just insert the new channel into the channel table..
Logged
Pages: [1]   Go Up