| 1 | <?php |
| 2 | require('../config/config.inc'); |
| 3 | |
| 4 | //connecting to database and creating universal $db object |
| 5 | require(SYSTEM_ROOT.'/inc/log.inc'); |
| 6 | require(SYSTEM_ROOT.'/inc/database.inc'); |
| 7 | require(SYSTEM_ROOT.'/inc/nodes.inc'); |
| 8 | $db=new CLASS_DATABASE(); |
| 9 | |
| 10 | $fd=fopen("hysteria.logins",'r'); |
| 11 | while(!feof($fd)) { |
| 12 | $data=fread($fd, 4096); |
| 13 | } |
| 14 | $array=explode("\n",$data); |
| 15 | |
| 16 | foreach ($array as $login) { |
| 17 | $result=$db->query("select user_id from users where login='$login'"); |
| 18 | if (!$result->getNumRows()) { |
| 19 | $db->query("insert into nodes set node_name='$login',node_type='7',node_parent='102',node_thread_vector=';1;102'"); |
| 20 | $id=$db->getLastInsertId(); |
| 21 | $db->query("insert into node_content set node_id='$id',node_content='hysteria user $login'"); |
| 22 | $db->query("insert into users set login='$login',user_id='$id'"); |
| 23 | } |
| 24 | else { |
| 25 | echo "duplicitny $login \n<br>"; |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | ?> |