| [ PHPXref.com ] | [ Generated: Sun Jul 20 20:01:31 2008 ] | [ PHPWind 4.3.2 ] |
| [ Index ] [ Variables ] [ Functions ] [ Classes ] [ Constants ] [ Statistics ] | ||
[Summary view] [Print] [Text view]
1 <?php 2 require_once ('global.php'); 3 require_once (R_P.'require/header.php'); 4 5 if ($groupid=='guest'){ 6 Showmsg('not_login'); 7 } elseif ($uid && !is_numeric($uid)){ 8 $errorname=''; 9 Showmsg('user_not_exists'); 10 } 11 if ($action != 'mailto' && $action != 'tofriend'){ 12 $action = 'mailto'; 13 } 14 if ($uid || $username){ 15 if ($uid){ 16 $sql="uid='$uid'"; 17 } else { 18 $sql="username='".addslashes($username)."'"; 19 } 20 $userdb=$db->get_one("SELECT uid,username,email,publicmail,receivemail FROM pw_members WHERE $sql"); 21 if (!$userdb['receivemail'] && $groupid!='3' && $groupid!='4'){ 22 Showmsg('sendeamil_refused'); 23 } 24 } 25 list(,,,,$othergd)=explode("\t",$db_gdcheck); 26 if (empty($step)){ 27 if ($uid || $username){ 28 if ($uid){ 29 $sql="uid='$uid'"; 30 } else { 31 $sql="username='".addslashes($username)."'"; 32 } 33 $userdb=$db->get_one("SELECT uid,username,email,publicmail,receivemail FROM pw_members WHERE $sql"); 34 if (!$userdb['receivemail'] && $groupid!='3' && $groupid!='4' && $windid!=$manager){ 35 Showmsg('sendeamil_refused'); 36 } 37 $to_mail=$userdb['email']; 38 $to_user=$userdb['username']; 39 if ($userdb['publicmail']!=1 && $groupid!='3' && $groupid!='4' && $windid!=$manager){ 40 $hiddenmail=1; 41 } else { 42 $hiddenmail=0; 43 } 44 } else { 45 $to_mail=""; 46 $to_user=""; 47 } 48 $atc_name=$ifdisabled=''; 49 if ($action=='mailto'){ 50 $ifdisabled='disabled'; 51 } elseif ($action=='tofriend'){ 52 !is_numeric($tid) && showmsg('illegal_tid'); 53 $atcinfo=$db->get_one("SELECT subject,author FROM pw_threads WHERE tid='$tid'"); 54 $atc_name=$atcinfo['subject']; 55 } 56 require_once(PrintEot('sendmail'));footer(); 57 } elseif ($_POST['step']=="2"){ 58 $othergd && GdConfirm($gdcode); 59 if ($action=='mailto'){ 60 $sendtoemail = $userdb['email']; 61 } 62 if (empty($subject)){ 63 Showmsg('sendeamil_subject_limit'); 64 } 65 if (empty($atc_content) || strlen($atc_content)<=20){ 66 Showmsg('sendeamil_content_limit'); 67 } elseif (!ereg("^[-a-zA-Z0-9_\.]+\@([0-9A-Za-z][0-9A-Za-z-]+\.)+[A-Za-z]{2,5}$",$sendtoemail) || !ereg("^[-a-zA-Z0-9_\.]+\@([0-9A-Za-z][0-9A-Za-z-]+\.)+[A-Za-z]{2,5}$",$fromemail)){ 68 Showmsg('illegal_email'); 69 } 70 if ($timestamp-GetCookie('lastwrite')<=60){//$gp_postpertime 71 Showmsg('sendeamil_limit'); 72 } 73 Cookie('lastwrite',$timestamp); 74 require_once (R_P.'require/sendemail.php'); 75 if (sendemail($sendtoemail,$subject,$atc_content,$winddb['email'])) { 76 refreshto('index.php','mail_success'); 77 } else { 78 Showmsg('mail_failed'); 79 } 80 } 81 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| [ Powered by PHPXref - Served by Debian GNU/Linux ] |