Commit | Line | Data |
---|---|---|
e586807d H |
1 | <?php |
2 | /* This program is free software. It comes without any warranty, to | |
3 | * the extent permitted by applicable law. You can redistribute it | |
4 | * and/or modify it under the terms of the Do What The Fuck You Want | |
5 | * To Public License, Version 2, as published by Sam Hocevar. See | |
6 | * http://sam.zoy.org/wtfpl/COPYING for more details. */ | |
7 | ||
8 | define(UBIK_ID,'332'); | |
9 | ||
10 | class ubik { | |
11 | ||
12 | ||
13 | function ubikRegister() { | |
14 | ||
15 | global $db; | |
16 | $user_info=$_POST['user_info']; | |
17 | $login=$_POST['login']; | |
18 | $checkboxes=$_POST['checkboxes']; | |
19 | $user_www=$_POST['user_www']; | |
20 | $email=$_POST['email']; | |
21 | $icq=$_POST['user_icq']; | |
22 | ||
23 | $node_name=Addslashes("register application from gateway ".$_SERVER['HTTP_HOST']." for user $login"); | |
24 | $text=nodes::processContent($user_info)."<br><br>"; | |
25 | ||
26 | if ($email) $text.="email :: $email<br>"; | |
27 | if ($user_www) $text.="www :: $user_www<br>"; | |
28 | ||
29 | print_r($checkboxes); | |
30 | ||
31 | foreach ($checkboxes as $key => $value) { | |
32 | $text.="$key<br>"; | |
33 | } | |
34 | /* | |
35 | $q="insert into nodes set node_created=NOW(),node_name='$node_name',node_system_access='public',node_external_access='no',node_parent=63802,node_vector=';101;63535;63557;63802',node_creator=".UBIK_ID; | |
36 | $db->query($q); | |
37 | $id=$db->getLastInsertId(); | |
38 | $q="insert into node_content set node_id='$id',node_content='$text'"; | |
39 | $db->query($q); | |
40 | return $id; | |
41 | */ | |
42 | $params['node_creator']=UBIK_ID; | |
43 | $params['node_content']=$text; | |
44 | $params['node_name']=$node_name; | |
45 | $params['node_parent']=63802; | |
46 | return nodes::addNode($params); | |
47 | ||
48 | } | |
49 | ||
50 | function ubikMail($params) { | |
51 | global $db; | |
52 | if (is_numeric($params['mail_to'])) $mail_to=$params['mail_to']; | |
53 | else return false; | |
54 | if (!empty($params['mail_text'])) $mail_text=addslashes($params['mail_text']); | |
55 | else return false; | |
56 | $q="insert into mail set mail_from='".UBIK_ID."',mail_to='$mail_to',mail_user='$mail_to',mail_timestamp=NOW(),mail_text='$mail_text'"; | |
57 | $db->query($q); | |
58 | $db->query("update users set user_mail_name='ubik',user_mail=user_mail+1 where user_id='$mail_to'"); | |
59 | ||
60 | } | |
61 | } | |
62 | ||
63 | ?> |