// set css classes for menue buttons $classes = array("overview" => "overview", "msgs" => "msgs", "tasks" => "tasks", "miles" => "miles", "files" => "files", "users" => "users_active", "tracker" => "tracking"); $mainclasses = array("desktop" => "", "profil" => "active", "admin" => ""); $template->assign("mainclasses", $mainclasses); $template->assign("classes", $classes); if ($action == "loginerror") { $template->display("resetpassword.tpl"); } elseif ($action == "resetpassword") { $newpass = $user->resetPassword($email); if ($newpass !== false) { $langFile = readLangfile($newpass['locale']); $subject = $langfile["projectpasswordsubject"]; $mailcontent = $langfile["hello"] . ",<br /><br/>" . $langfile["projectpasswordtext"] . "<br /><br />" . $langfile["newpass"] . ": " . $newpass['newpass'] . "<br />" . $langfile["login"] . ": <a href = \"{$url}\">{$url}</a>"; // Send e-mail with new password $themail = new emailer($settings); $themail->send_mail($email, $subject, $mailcontent); $template->assign("success", 1); $template->display("resetpassword.tpl"); } else { $template->assign("loginerror", 1); $template->display("resetpassword.tpl"); } } elseif ($action == "login") { $openid = getArrayVal($_POST, "openid"); $username = getArrayVal($_POST, "username"); $pass = getArrayVal($_POST, "pass"); // Normal login if ($user->login($username, $pass)) { $loc = $url . "index.php?mode=login"; header("Location: {$loc}"); } else {
// assemble content only once. no need to do this repeatedly $mailcontent = $userlang["hello"] . ",<br /><br/>" . $userlang["filecreatedtext"] . "<br /><br />" . $userlang["project"] . ": " . $pname["name"] . "<br />" . $userlang["folder"] . ": " . $whichfolder . "<br />" . $userlang["file"] . ": <a href = \"" . $url . "managefile.php?action=downloadfile&file=" . $fileprops["ID"] . "\">" . $url . "managefile.php?action=downloadfile&file=" . $fileprops["ID"] . "</a>"; //$userlang["file"] . ": <a href = \"" . $url . $fileprops["datei"] . "\">" . $url . $fileprops["datei"] . "</a>"; $subject = $userlang["filecreatedsubject"] . " (" . $userlang['by'] . ' ' . $username . ")"; //if sendto is an array multiple users need to be notified if (is_array($sendto)) { //check if the current user is in the notifications array if (in_array($user["ID"], $sendto)) { // send email $themail = new emailer($settings); $themail->send_mail($user["email"], $subject, $mailcontent); } } else { // send email $themail = new emailer($settings); $themail->send_mail($user["email"], $subject, $mailcontent); } } } } } $loc = $url .= "managefile.php?action=showproject&id={$id}&mode=added"; // header("Location: $loc"); echo "UPLOADED"; } elseif ($action == "editform") { if (!$userpermissions["files"]["edit"]) { $errtxt = $langfile["nopermission"]; $noperm = $langfile["accessdenied"]; $template->assign("errortext", "<h2>{$errtxt}</h2><br>{$noperm}"); $template->display("error.tpl"); die;
if (!$userpermissions["projects"]["edit"]) { $errtxt = $langfile["nopermission"]; $noperm = $langfile["accessdenied"]; $template->assign("errortext", "$errtxt<br>$noperm"); $template->display("error.tpl"); die(); } if ($project->assign($user, $id)) { if ($settings["mailnotify"]) { $usr = (object) new user(); $user = $usr->getProfile($user); if (!empty($user["email"])) { // send email $themail = new emailer($settings); $themail->send_mail($user["email"], $langfile["projectassignedsubject"] , $langfile["hello"] . ",<br /><br/>" . $langfile["projectassignedtext"] . " <a href = \"" . $url . "manageproject.php?action=showproject&id=$id\">" . $url . "manageproject.php?action=showproject&id=$id</a>"); } } if ($redir) { $loc = $url . $redir; } else { $loc = $url . "manageuser.php?action=showproject&id=$id&mode=assigned"; } header("Location: $loc"); } } elseif ($action == "deassignform") { if (!$userpermissions["projects"]["edit"]) { $errtxt = $langfile["nopermission"]; $noperm = $langfile["accessdenied"]; $template->assign("errortext", "$errtxt<br>$noperm"); $template->display("error.tpl");
echo 'Сообщение игроку <b><font color=red>' . $komu[$i] . '</font></b> отправлено<br>'; list($send_pm_email, $email_komu, $send_ICQ, $ICQnumber, $ICQ_pm) = mysql_fetch_array(myquery("SELECT send_pm,email,send_ICQ,ICQnumber,ICQ_pm FROM game_users_data WHERE user_id={$userid}")); if ($send_pm_email == 1) { include "{$dirclass}/class_email.php"; $otkogo = $char['name']; $message = "[http://" . domain_name . "] Средиземье :: Эпоха сражений. Письмо от {$otkogo}\n\n"; $message .= "Тема: {$theme}\n"; $message .= "Дата: " . date("H-i d-m-Y") . "\n"; $message .= "Содержание: \n{$post}\n"; $subject = 'Средиземье :: Эпоха сражений. Письмо от ' . $otkogo . '.'; $e_mail = new emailer(); $e_mail->email_init(); $e_mail->to = $email_komu; $e_mail->subject = $subject; $e_mail->message = $message; $e_mail->send_mail(); } } else { echo 'Игрока <b><font color=red>' . $komu[$i] . '</font></b> не существует!<br>'; } } } echo '<meta http-equiv="refresh" content="3;url=act.php?func=pm&new">'; } else { //Пишем письмо if (!isset($_GET['komu'])) { echo '<div id="content" onclick="hideSuggestions();">'; } echo '<table width="100%" border="0" cellpadding="3">'; echo '<tr><td></td><td>Чтобы написать сразу нескольким игрокам - напишите их имена через знак ","</td><td></td></tr>'; echo '<form action="" method="post"';
$sendto = array(); } foreach($users as $user) { if (!empty($user["email"])) { if (is_array($sendto)) { if (in_array($user["ID"], $sendto)) { // check if subfolder exists, else root folder $whichfolder = (!empty($thefolder)) ? $thefolder : $langfile["rootdir"]; // send email $themail = new emailer($settings); $themail->send_mail($user["email"], $langfile["filecreatedsubject"], $langfile["hello"] . ",<br /><br/>" . $langfile["filecreatedtext"] . "<br /><br />" . $langfile["project"] . ": " . $pname["name"] . "<br />" . $langfile["folder"] . ": " . $whichfolder . "<br />" . $langfile["file"] . ": <a href = \"" . $url . $fileprops["datei"] . "\">" . $url . $fileprops["datei"] . "</a>"); } } else { // send email $themail = new emailer($settings); $themail->send_mail($user["email"], $langfile["filecreatedsubject"], ""); } } } } } $loc = $url .= "managefile.php?action=showproject&id=$id&mode=added"; //header("Location: $loc"); echo "UPLOADED"; } elseif ($action == "editform") { if (!$userpermissions["files"]["edit"]) { $errtxt = $langfile["nopermission"]; $noperm = $langfile["accessdenied"]; $template->assign("errortext", "<h2>$errtxt</h2><br>$noperm"); $template->display("error.tpl");
if (!empty($user["email"])) { if (is_array($sendto)) { if (in_array($user["ID"], $sendto)) { // send email $themail = new emailer($settings); $themail->send_mail($user["email"], $langfile["messagewasaddedsubject"], $langfile["hello"] . ",<br /><br/>" . $langfile["messagewasaddedtext"] . "<br /><br />" . $message . "<br /><br /><a href = \"" . $url . "managemessage.php?action=showmessage&id=$id&mid=$themsg\">$title</a>"); } } else { // send email $themail = new emailer($settings); $themail->send_mail($user["email"], $langfile["messagewasaddedsubject"], $langfile["hello"] . ",<br /><br/>" . $langfile["messagewasaddedtext"] . "<br /><br />". $message . "<br /><br /><a href = \"" . $url . "managemessage.php?action=showmessage&id=$id&mid=$themsg\">$title</a>"); } } } } $loc = $url . "managemessage.php?action=showmessage&mid=$mid_post&id=$id&mode=replied"; header("Location: $loc"); } } elseif ($action == "mymsgs") { // create new project and file objects $project = new project(); $myfile = new datei(); // get all uof the users projects $myprojects = $project->getMyProjects($userid);
} else { echo "ok"; } } else { $template->assign("closetask", 0); } } elseif ($action == "assign") { if ($task->assign($id, $user)) { if ($settings["mailnotify"]) { $usr = (object) new user(); $user = $usr->getProfile($user); if (!empty($user["email"])) { // send email $themail = new emailer($settings); $themail->send_mail($user["email"], $langfile["taskassignedsubject"] , $langfile["hello"] . ",<br /><br/>" . $langfile["taskassignedtext"] . " <a href = \"" . $url . "managetask.php?action=showtask&id=$id&tid=$tid\">$title</a>"); } } $template->assign("assigntask", 1); $template->display("mytasks.tpl"); } else { $template->assign("assigntask", 0); } } elseif ($action == "deassign") { if ($task->deassign($id, $user)) { $template->assign("deassigntask", 1); $template->display("mytasks.tpl"); } else { $template->assign("deassigntask", 0); } } elseif ($action == "showproject") {
$mainclasses = array("desktop" => "", "profil" => "active", "admin" => "" ); $template->assign("mainclasses", $mainclasses); $template->assign("classes", $classes); if ($action == "loginerror") { $template->display("resetpassword.tpl"); } elseif ($action == "resetpassword") { $newpass = $user->resetPassword($email); if ($newpass != "") { // Send e-mail with new password $themail = new emailer($settings); $themail->send_mail($email, $langfile["projectpasswordsubject"], $langfile["hello"] . ",<br /><br/>" . $langfile["projectpasswordtext"] . "<br /><br />" . $langfile["newpass"] . ": " . "$newpass<br />" . $langfile["login"] . ": <a href = \"$url\">$url</a>"); $template->assign("success", 1); $template->display("resetpassword.tpl"); } else { $template->assign("loginerror", 1); $template->display("resetpassword.tpl"); } } elseif ($action == "login") { $mode = getArrayVal($_GET, "openid_mode"); $username = getArrayVal($_POST, "username"); $pass = getArrayVal($_POST, "pass"); // normal login if ($user->login($username, $pass)) { $loc = $url . "index.php?mode=login"; header("Location: $loc");
function EndRegistration() { include "class/class_email.php"; global $_POST; echo '<center>'; echo ' <table width="100%" height=10 border="0" cellspacing="0" cellpadding="0" align=center> <tr> <td width="15"><img src="http://' . img_domain . '/nav/1_01.jpg" width="15" height="33"></td> <td width="23" background="http://' . img_domain . '/nav/1_03.jpg"><img src="http://' . img_domain . '/nav/1_04_1.jpg" width="70" height="33"></td> <td background="http://' . img_domain . '/nav/1_03.jpg"><div align="center"><br>Средиземье :: Регистрация</div></td> <td width="70" background="http://' . img_domain . '/nav/1_03.jpg"><img src="http://' . img_domain . '/nav/1_04.jpg" width="70" height="33"></td> <td width="10"><img src="http://' . img_domain . '/nav/1_05.jpg" width="15" height="33"></td> </tr> <tr> <td width="15" height="90" background="http://' . img_domain . '/nav/1_16.jpg"></td> <td colspan="3"><div align="center"> <table width="100%" height="100%" border="0" align="right" cellpadding="0" cellspacing="0"> <tr> <td width="5"><img src="http://' . img_domain . '/nav/1_07.jpg" width="5" height="6"></td> <td background="http://' . img_domain . '/nav/1_09.jpg"></td> <td width="5"><img src="http://' . img_domain . '/nav/1_10.jpg" width="7" height="6"></td> </tr> <tr> <td width="5" height="100%" background="http://' . img_domain . '/nav/1_17.jpg"></td><td height="50" bgcolor="313131"><center>'; if (isset($_POST['user_name'])) { $user_name = trim($_POST['user_name']); } else { $user_name = ''; } if (isset($_POST['email'])) { $email = $_POST['email']; } else { $email = ''; } if (isset($_POST['name'])) { $name = trim($_POST['name']); } else { $name = ''; } if (isset($_POST['status'])) { $status = $_POST['status']; } else { $status = ''; } if (isset($_POST['avata'])) { $avata = $_POST['avata']; } else { $avata = ''; } if (isset($_POST['gorod'])) { $gorod = $_POST['gorod']; } else { $gorod = ''; } if (isset($_POST['hobbi'])) { $hobbi = $_POST['hobbi']; } else { $hobbi = ''; } if (isset($_POST['info'])) { $info = $_POST['info']; } else { $info = ''; } if (isset($_POST['dn'])) { $dn = $_POST['dn']; } else { $dn = ''; } if (isset($_POST['ms'])) { $ms = $_POST['ms']; } else { $ms = ''; } if (isset($_POST['god'])) { $god = $_POST['god']; } else { $god = ''; } if (isset($_POST['uid'])) { $uid = $_POST['uid']; } else { $uid = ''; } if (isset($_POST['sex'])) { $sex = $_POST['sex']; } else { $sex = ''; } if (isset($_POST['sogl'])) { $sogl = $_POST['sogl']; } else { $sogl = ''; } @($_SESSION['values']['user_name'] = $user_name); @($_SESSION['values']['email'] = $email); @($_SESSION['values']['name'] = $name); @($_SESSION['values']['status'] = $status); @($_SESSION['values']['avata'] = $avata); @($_SESSION['values']['gorod'] = $gorod); @($_SESSION['values']['hobbi'] = $hobbi); @($_SESSION['values']['info'] = $info); @($_SESSION['values']['dn'] = $dn); @($_SESSION['values']['ms'] = $ms); @($_SESSION['values']['god'] = $god); @($_SESSION['values']['uid'] = $uid); @($_SESSION['values']['sex'] = $sex); $error_msg = ''; if (!isset($sogl)) { $sogl = 0; } setlocale(LC_ALL, "ru_RU.CP1251"); $String_AM = new anti_mate(); $user_name_filter = $String_AM->filter($user_name); $name_filter = $String_AM->filter($name); if (!($user_name && $email && $name)) { $error_msg = 'Заполните все поля.</a>'; } elseif (!preg_match('/^[_a-zA-Z0-9-]+(\\.[_a-zzA-Z0-9-]+)*@[_a-zzA-Z0-9-]+(\\.[a-zzA-Z0-9-]+)*$/', $email)) { $error_msg = 'Неправильный е-майл'; $email = '*Ошибка'; } elseif (!preg_match('/^[_a-zA-Zа-яА-Я0-9]*$/', $user_name)) { $error_msg = 'Неправильный логин (он должен состоять только из символов латиницы, кириллицы и цифр).'; $user_name = '*Ошибка'; } elseif ($user_name != $user_name_filter) { $error_msg = 'Логин не пропущен цензурой. Выберите другой логин!'; $name = '*Ошибка'; } elseif (!preg_match('/1/', $sogl)) { $error_msg = 'Вы не согласны с Законами Средиземья.'; } elseif (!preg_match('/^[_a-zA-Zа-яА-Я]*$/', $name)) { $error_msg = 'Неправильное игровое имя (разрешены только символы кириллицы или латиницы)'; $name = '*Ошибка'; } elseif ($name != $name_filter) { $error_msg = 'Игровое имя не пропущено цензурой. Выберите другое имя!'; $name = '*Ошибка'; } elseif (strlen($name) < 5 or strlen($name) > 16) { $error_msg = 'Некорректная длина игрового имени. Выберите другое имя!'; $name = '*Ошибка'; } elseif (!check_lang($name)) { $error_msg = 'Нельзя смешивать языки в игровом имени. Выберите другое имя!'; $name = '*Ошибка'; } else { $result = myquery("SELECT user_id FROM game_users WHERE user_name='{$user_name}' LIMIT 1"); if (!mysql_num_rows($result)) { $result = myquery("SELECT user_id FROM game_users_archive WHERE user_name='{$user_name}' LIMIT 1"); } if (mysql_num_rows($result) != 0) { $error_msg = 'Извините, но логин ' . $user_name . ' уже используется в игре!'; $user_name = "*{$user_name}"; } $result = myquery("SELECT user_id FROM game_users WHERE name='{$name}' LIMIT 1"); if (!mysql_num_rows($result)) { $result = myquery("SELECT user_id FROM game_users_archive WHERE name='{$name}' LIMIT 1"); } if (mysql_num_rows($result) != 0) { $error_msg = 'Извините, но имя ' . $name . ' уже используется в игре!'; $name = "*{$name}"; } $result = myquery("SELECT user_id FROM game_users_data WHERE email='{$email}' LIMIT 1"); if (mysql_num_rows($result) != 0) { $error_msg = 'Такой е-майл уже используется'; $email = "*{$email}"; } } if (!isset($_SESSION['captcha'])) { $error_msg = '1. Неправильно введено кодовое число'; } elseif (!isset($_POST['captcha'])) { $error_msg = '2. Неправильно введено кодовое число'; } elseif ($_SESSION['captcha'] != $_POST['captcha']) { $error_msg = '3. Неправильно введено кодовое число'; } $result = myquery("SELECT * FROM game_har WHERE race='{$avata}' and disable=0"); if (mysql_num_rows($result) == 0) { $error_msg = 'Выбрана неправильная раса'; } if ($error_msg == '') { $user_time = time(); $info = htmlspecialchars($info); $row = mysql_fetch_array($result); $hp1 = $row["hp"]; $hp_max1 = $row["hp_max"]; $mp1 = $row["mp"]; $mp_max1 = $row["mp_max"]; $stm1 = $row["stm"]; $stm_max1 = $row["stm_max"]; $exp1 = $row["exp"]; $invite = 0; if (isset($uid) and $uid != '') { $uid = (int) $uid; $u = myquery("SELECT name FROM game_users WHERE user_id='{$uid}'"); if (!mysql_num_rows($u)) { $u = myquery("SELECT name FROM game_users_archive WHERE user_id='{$uid}'"); } $sel = myquery("SELECT host FROM game_users_active WHERE user_id='{$uid}'"); if ($sel != false and mysql_num_rows($sel) > 0) { $host_p = mysql_result($sel, 0, 0); } else { $host_p = ""; } list($name_p) = mysql_fetch_array($u); $user_host_p = HostIdentify(); if ($uid > 0 and $user_host_p != $host_p) { $gp1 = $row["gp"] + 100; $invite = 1; } else { $gp1 = $row["gp"]; } } else { $gp1 = $row["gp"]; } $str1 = $row["str"]; $ntl1 = $row["ntl"]; $pie1 = $row["pie"]; $vit1 = $row["vit"]; $dex1 = $row["dex"]; $spd1 = $row["spd"]; //$lucky1=$row["lucky"]; //$vospr1=$row["vospr"]; //$magic_res1=$row["magic_res"]; $avatar = $row["race"]; $start_map_name = $row["map_name"]; $start_map_x = $row["map_x"]; $start_map_y = $row["map_y"]; $avatar = $avatar . '_' . $sex . '.gif'; $user_pass = generate_password(10); $result = myquery("\n\t\t\tINSERT game_users SET\n\t\t\tuser_name='{$user_name}',\n\t\t\tuser_pass='******',\n\t\t\tname='{$name}',\n\t\t\tHP='{$hp1}',\n\t\t\tHP_MAX='{$hp_max1}',\n\t\t\tHP_MAXX='{$hp_max1}',\n\t\t\tMP='{$mp1}',\n\t\t\tMP_MAX='{$mp_max1}',\n\t\t\tSTM='{$stm1}',\n\t\t\tSTM_MAX='{$stm_max1}',\n\t\t\tEXP='{$exp1}',\n\t\t\tGP='{$gp1}',\n\t\t\tSTR='{$str1}',\n\t\t\tNTL='{$ntl1}',\n\t\t\tPIE='{$pie1}',\n\t\t\tVIT='{$vit1}',\n\t\t\tDEX='{$dex1}',\n\t\t\tSPD='{$spd1}',\n\t\t\tSTR_MAX='{$str1}',\n\t\t\tNTL_MAX='{$ntl1}',\n\t\t\tPIE_MAX='{$pie1}',\n\t\t\tVIT_MAX='{$vit1}',\n\t\t\tDEX_MAX='{$dex1}',\n\t\t\tSPD_MAX='{$spd1}',\n\t\t\tCW='" . $gp1 * money_weight . "',\n\t\t\tCC=40,\n\t\t\trace=" . $row['id'] . ",\n\t\t\tavatar='{$avatar}'\n\t\t\t") or die('Database Error: ' . mysql_error() . '<br>'); $newuserid = mysql_insert_id(); setGP($newuserid, $gp1, 4); if ($invite == 1) { myquery("INSERT INTO game_invite (user_id,invite_id,invite_regtime) VALUES ({$uid},{$newuserid}," . time() . ")"); } //lucky='$lucky1', //lucky_max='$lucky1', //vospr='$vospr1', //vospr_max='$vospr1', //magic_res='$magic_res1', //magic_res_max='$magic_res1', //$result = myquery("DELETE FROM game_users_reg WHERE user_name = '$user_name'"); $sel_uid = myquery("SELECT user_id FROM game_users WHERE user_name='{$user_name}'"); list($uid) = mysql_fetch_array($sel_uid); $result = myquery("\n\t\t\tINSERT game_users_map SET\n\t\t\tuser_id='{$uid}',\n\t\t\tmap_name='{$start_map_name}',\n\t\t\tmap_xpos='{$start_map_x}',\n\t\t\tmap_ypos='{$start_map_y}'\n\t\t\t") or die('Database Error: ' . mysql_error() . '<br>'); $result = myquery("\n\t\t\tINSERT game_users_data SET\n\t\t\tuser_id='{$uid}',\n\t\t\temail='{$email}',\n\t\t\tstatus='{$status}',\n\t\t\tgorod='{$gorod}',\n\t\t\thobbi='{$hobbi}',\n\t\t\tinfo='{$info}',\n\t\t\tdr_date='{$dn}',\n\t\t\tdr_month='{$ms}',\n\t\t\tdr_year='{$god}',\n\t\t\tsex='{$sex}',\n\t\t\trego_time='{$user_time}'\n\t\t\t") or die('Database Error: ' . mysql_error() . '<br>'); myquery("INSERT INTO game_users_active (user_id,host,last_active) VALUES ('{$uid}','" . HostIdentify() . "','')"); myquery("INSERT INTO game_users_active_host (user_id,host_more) VALUES ('{$uid}','" . HostIdentifyMore() . "')"); myquery("INSERT INTO game_chat_option (user_id,ref,size,frame) VALUES ('{$uid}','1','13','250')"); $message = "Привет, {$name}!\n\n"; $message .= "Вы зарегистрировались в ролевой онлайн игре Средиземье :: Эпоха сражений\n\n"; $message .= "Ваши данные:\n"; $message .= "Логин: {$user_name}\n"; $message .= "Пароль: {$user_pass}\n\n"; $subject = 'Средиземье :: Эпоха сражений - ' . domain_name . ''; $e_mail = new emailer(); $e_mail->email_init(); $e_mail->to = $email; $e_mail->subject = $subject; $e_mail->message = $message; $e_mail->send_mail(); echo '<br>Спасибо за регистрацию<br><br> Теперь Вы можете войти в наш мир! <br>Пусть не за горами будет тот день, когда все Средиземье будет содрогаться от звука Вашего имени!<br> <br><br><a href="' . $_SERVER['PHP_SELF'] . '">На главную страницу</a>'; } else { $error_msg = 'Ошибка: ' . $error_msg . '<br><br><a href="' . $_SERVER['PHP_SELF'] . '?option=register">Назад</a>'; echo $error_msg; } echo '</td> <td width="5" height="50" background="http://' . img_domain . '/nav/1_15.jpg"></td> </tr> <tr> <td width="5"><img src="http://' . img_domain . '/nav/1_19.jpg" width="5" height="8"></td> <td background="http://' . img_domain . '/nav/1_20.jpg"></td> <td><img src="http://' . img_domain . '/nav/1_22.jpg" width="7" height="8"> </td> </tr> </table> </div> </td> <td width="10" background="http://' . img_domain . '/nav/333_17.jpg"> </td> </tr> <tr> <td width="15"><img src="http://' . img_domain . '/nav/1_23.jpg" width="15" height="14"></td> <td colspan="3" background="http://' . img_domain . '/nav/1_25.jpg"></td> <td><img src="http://' . img_domain . '/nav/1_26.jpg" width="15" height="14"></td> </tr> </table>'; }