$db_host='localhost'; $db_user='mpa3_admin'; $db_pass='ilphyeb5'; $db_pass_backup=''; $tables_header='1'; $tables_odd='2'; $tables_even='3'; $cookie_exp='336'; $twotier_percent='5'; $ip_exp='336'; $local_wire_fee='0'; $international_wire_fee='30'; $local_check_fee='0'; $international_check_fee='0'; $local_ipayout_fee='0'; $international_ipayout_fee='0'; $local_epass_fee='0'; $international_epass_fee='0'; $processing_fees='0'; $curl='/usr/local/bin/curl'; $path_to_php=''; $program_name='Gunzblazing V5'; $eur_usd_rate='1.27'; $default_program='4'; $default_site='2'; $sms_params='11'; $f2g_min_payout='74'; $mpush_id=''; $mpush_password=''; $mpush_percent=''; $wm_ref_redirect_url='http://www.gunzblazing.com/'; $check_threshold='25'; $rebills_threshold='25'; $currency_sign='$'; $minpayoutsteps='50,100,150,200,250,500,1000,1500,2000,2500,3000,5000'; $vat=''; $localbilling_active=''; $hide_trials_days='35'; $ipayout_mid='0cdd515f-aa1a-4566-a87b-17197772f232'; $ipayout_username='brian@pistolmedia.com'; $ipayout_password='aebn23'; $ipayout_test_mode='0'; $ipayout_upload_automatically='0'; $table_heading=''; $table_dark=''; $table_light=''; $consoles_active='0'; $no_affiliate_no_trial='0'; $active_banlist='0'; $ct_set=''; $auto_approve='0'; $email_confirmations='0'; $auto_approve_on_email='0'; $irs_usa='0'; $enable_cexit='0'; $test_mode='1'; $links_to_mpa2=''; $use_sql='1'; $no_credit_webmaster='100002'; $webmasters_approval=''; $merge_follow_me='1'; $reduce_active_chargebacks='0'; $show_fees='0'; $use_eu='1'; $f2g_active='0'; $aff_rep_links_override='0'; $epoch_direct_jp='1'; $send_member_approve_email='0'; $ipayout_test_mode='0'; $ipayout_upload_automatically='0'; $paxum_email=''; $paxum_loginid=''; $paxum_test_mode=''; $paxum_upload_automatically=''; $local_paxum_fee='0'; $international_paxum_fee='0'; ?> ?> function Encrypt($string, $public_key) { $fp = fopen($public_key, "r"); $pkey = fread($fp, 8192); fclose($fp); openssl_get_publickey($pkey); // encrypt openssl_public_encrypt($string, $encrypted_string, $pkey); return $encrypted_string; } function encdec($str_message, $dec=0) { return $str_message; global $key_shift; $passkey = ($key_shift*$key_shift-$key_shift)*($key_shift*$key_shift)*$key_shift; $str_message = utf8_decode($str_message); if($dec) { $str_message = substr_replace($str_message,"",-strlen($passkey)); } $len_str_message=strlen($str_message); $str_encrypted_message=""; for ($position = 0;$position<$len_str_message;$position++) { //$key_to_use = (($len_str_message+$position)+1); $key_to_use = $position*$position + $key_shift; $key_to_use = (255+$key_to_use) % 255; $byte_to_be_encrypted = substr($str_message, $position, 1); $ascii_num_byte_to_encrypt = ord($byte_to_be_encrypted); $xored_byte = $ascii_num_byte_to_encrypt ^ $key_to_use; //xor operation $encrypted_byte = chr($xored_byte); $str_encrypted_message .= $encrypted_byte; } if($dec == 0) $str_encrypted_message .= $passkey; return utf8_encode($str_encrypted_message); } function encordec($str) { return $str; global $key_shift; $passkey = ($key_shift*$key_shift-$key_shift)*($key_shift*$key_shift)*$key_shift; if( !preg_match("/$passkey/", $str )) return $str; else return encdec($str,1); } ?> $gallery_db_host=''; $gallery_db_name=''; $gallery_db_user=''; $gallery_db_pass=''; $gallhits_path=''; $gallhit_url=''; $god_db_host=''; $god_db_name=''; $god_db_user=''; $god_db_pass=''; $godhits_path=''; $godhit_url=''; $hg_as_gotd_source=''; $hg_as_gotd_to_use='0'; $pod_db_host=''; $pod_db_name=''; $pod_db_user=''; $pod_db_pass=''; $podhits_path=''; $podhit_url=''; $no_commas='0'; ?> //hostname_check class Member { public $id; public $subscription_id; public $transaction_id; public $ip; public $username; public $password; public $email; public $fname; public $lname; public $address; public $city; public $state; public $fstate; public $zip; public $country; public $fcountry; public $iso_country; public $site; public $product; public $product_code; public $initial_days; public $initial_price; public $recur_days; public $recur_price; public $free_trial; public $processor; public $webmaster; public $sdate; public $edate; public $post_ip; public $cancelled; public $deleted; public $deleted_date; public $keyword; public $pending_time; public $table; public $status; public $ch_details = true; public $monitored_fields = array('username', 'password'); public $ch_details_email_template = 'mem_ch_details_email.html'; public $minimum_email_length = 10; public $program; public $original_program; public $language; private $key; public function Member($sid,$key='username',$status='active',$create=1) /* $sid - search id - stoynostta na variable, po koyato se tarsi $key - imeto na variable za search - id, username, subscription_id ili check (check se polzva za proverka za sashtestvuvash username predi sazdavane na membera, proveryava za active i pending) $status - statusa na membera - active, pending, inactive $create - 0 ili 1 - pri 1 ako ne sashtestvuva takav member go sazdava avtomatichno */ { global $conn; $this->key = $key; $this->status($status); $sql = "SELECT * FROM $this->table WHERE id = -1"; $result = $conn->Execute($sql); $obj_vars = $result->FetchObj(); if (array_key_exists($key, $obj_vars)) { $query = "SELECT * from $this->table where $key='$sid'"; $result = $conn->GetAll($query); if (! is_array($result[0])) $result[0] = array();//return 0; $row = $result[0]; foreach ($row as $property_name=>$value) { $this->$property_name = $value; } $this->password = encordec($this->password); $this->email = encordec($this->email); $this->keyword = $this->make_key(); } if($key == 'assoc' && is_array($sid)){ $query = "SELECT * from $this->table where "; $wlist = array(); foreach ($sid as $key => $value){ if(array_key_exists($key, $obj_vars)){ $wlist[] = "$key='$value'"; } } if(count($wlist)){ $query.= ' '.implode(' AND ', $wlist); $result = $conn->GetAll($query); if (!is_array($result[0])) $result[0] = array();//return 0; $row = $result[0]; foreach ($row as $property_name=>$value) { $this->$property_name = $value; } $this->password = encordec($this->password); $this->email = encordec($this->email); $this->keyword = $this->make_key(); } } if (!$this->id && $create && $key=='username') { $this->username = $sid; $this->create(); } if ($key=='check') { $csite = null; if(is_array($sid)){ $this->username = $sid['username']; $csite = $sid['site']; }else{ $this->username = $sid; } $this->status('active'); $this->read_username($csite); if ($this->id) return 0; $this->status('pending'); $this->read_username($csite); if ($this->id) return 0; $this->status('inactive'); $this->read_username($csite); if ($this->id) return 0; $this->status('old'); $this->read_username($csite); if ($this->id) return 0; // } } public function status($status) // Inicializira statusa na membera kato avtomatichno izbira s koya members tablica shte raboti { $this->table = TBL_PREFIX.$status."_members"; $this->status = $status; } public function read_username($site = null) // Chetene ot DB pri zadaden username { global $conn, $ADODB_FETCH_MODE; $query = "SELECT * from $this->table where username='$this->username'"; if($site){ $query.=" AND site='$site'"; } $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; $result = $conn->GetAll($query); if (! is_array($result[0])) { $this->id=0; return 1; } $row = $result[0]; //90% sure this should delete old inactive members of the same usename that are 2 weeks old //or that are cancelled greater than 4 days if($this->table == TBL_PREFIX."inactive_members" && $this->key == 'check'){ $delaytime = date("Y-m-d", strtotime("-4 days")); if(( ($row['deleted'] != '1' && $row['deleted'] != '0') || ($row['cancelled'] != '1' && $row['cancelled'] != '0') ) || ($row['deleted'] == '1' && ($row['deleted_date']<$delaytime || $row['deleted_date']==NULL)) || ($row['cancelled'] == '1' && ($row['cancelled_date']<$delaytime || $row['cancelled_date']==NULL)) ){ $i_mem = array(); foreach ($row as $property_name=>$value) { if($property_name != 'id'){ $i_mem[$property_name] = $value; } } $i_mem['id'] = 0; $sql = "SELECT * FROM ".TBL_PREFIX."former_members WHERE id = -1"; $res = $conn->Execute($sql); $insertSQL = $conn->GetInsertSQL($res, $i_mem); $conn->Execute($insertSQL); $query = "DELETE from $this->table where username=?"; $conn->Execute($query, array($this->username)); $this->id=0; return 1; } } foreach ($row as $property_name=>$value) { $this->$property_name = $value; } $this->password = encordec($this->password); $this->email = encordec($this->email); } public function read_subscription() // Chetene ot DB pri zadaden subscription_id { global $conn, $ADODB_FETCH_MODE; if ($id) $this->id=$id; $query = "SELECT * from $this->table where subscription_id='$this->subscription_id'"; $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; $result = $conn->GetAll($query); if (! is_array($result[0])) { return 0; } $row = $result[0]; foreach ($row as $property_name=>$value) { $this->$property_name = $value; } $this->password = encordec($this->password); $this->email = encordec($this->email); } public function read() // Chete ot DB pri zadadeno id na member (id e autoincrement index v tablicite) { global $conn, $ADODB_FETCH_MODE; if ($id) $this->id=$id; $query = "SELECT * from $this->table where id='$this->id'"; $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; $result = $conn->GetAll($query); if (! is_array($result[0])) { return 0; } $row = $result[0]; foreach ($row as $property_name=>$value) { $this->$property_name = $value; } $this->password = encordec($this->password); $this->email = encordec($this->email); } public function save() // zapisva v bazata danni { global $conn; $this->date_edited = date("Y-m-d h:i:s"); $this->keyword = $this->make_key(); $sql = "SELECT * FROM $this->table WHERE id='$this->id'"; $result = $conn->Execute($sql); $obj_vars = $result->FetchObj(); foreach($obj_vars as $var=>$val) if (! isset($this->$var)) $this->$var = ''; $this->password = encdec(encordec($this->password)); $this->email = encdec(encordec($this->email)); if ($this->massmail=='')$this->massmail=1; $updateSQL = $conn->GetUpdateSQL($result, get_object_vars($this)); if ($updateSQL) $conn->Execute($updateSQL); $this->password = encordec($this->password); $this->email = encordec($this->email); } public function del() // trie ot bazata danni { global $conn; $sql = "DELETE FROM $this->table WHERE id='$this->id'"; $conn->Execute($sql); $this->id = 0; return $conn->Affected_Rows(); } public function update($properties,$save_it=1) // $properties e asociativen array, $save_it = 0 | 1 - pri 1 avtomatichno zapisva v bazata danni napravenite promeni { if(!is_array($properties)) return false; foreach($properties as $property=>$value) { if ($this->$property != $value) { $this->$property = $value; } } $this->keyword = $this->make_key(); if ($save_it) $this->save(); } public function create($properties=null) // sazdava membera, moje da se forsira s asociativen array ot stoynosti za membera - fname, lname, email... { global $conn; define('ADODB_FORCE_NULLS',0); if ($this->id) return 0; if (! $properties) $properties = get_object_vars($this); foreach ($properties as $property_name=>$value) { $this->$property_name = $value; } $this->password = encdec($this->password); $this->email = encdec($this->email); $this->keyword = $this->make_key(); $sql = "SELECT * FROM $this->table WHERE id = -1"; $result = $conn->Execute($sql); $obj_vars = $result->FetchObj(); foreach($obj_vars as $var=>$val) if (! isset($this->$var)) $this->$var = ''; if ($conn->no_autoincrement) $this->id = $conn->GenID("seq_".$this->table,1); $insertSQL = $conn->GetInsertSQL($result, get_object_vars($this)); $conn->Execute($insertSQL); if (! $this->id) {$this->id = $conn->Insert_ID();} $this->password = encordec($this->password); $this->email = encordec($this->email); } public function fix_address() // Opravya addressa na member-a kato popalva vsichki countries poleta sas saotvetnite codes // Griji se da oznachi dali membera e ot Asia ili Europe za rabota s 2000charge { require_once(CLASSES_PATH."state.class.php"); require_once(CLASSES_PATH."country.class.php"); $country = new Country($this->country,'iso_2'); $state = new State($this->state); $geo_tracing = ($country->continent=='Asia' || $country->continent=='Europe')?1:0; if ($this->country!='US' && $this->country!='CA' && $this->site <> 35 && $this->webmaster <>'102651' && $this->site <> 55) { $geo_tracing = 1; } else { $geo_tracing=0; } $this->update(array('fcountry' => $country->name, 'iso_country' => $country->iso_no, 'fstate' => $state->name, 'geo_tracing' => $geo_tracing)); unset($country); unset($state); } public function make_key() // Sazdava unique keyword za saotvetniya member - izpolzva se pri signups za verifikaciya { return abs(crc32("$this->username:$this->password - tralala")); } public function toString($delimiter = "\n") { $asArray = get_object_vars($this); foreach ($asArray as $key=>$val) $str.="$key = $val".$delimiter; return $str; } public function grant_access() // Razreshava dostap na membera do saotvetniya site { global $conn; include_once (CLASSES_PATH."site.class.php"); if ($this->password=='') return 1; if ($this->site) { $theSite = new Site($this->site); $res = $theSite->addMember($this->username, $this->password); unset($theSite); } else { $q = "select id from ". TBL_PREFIX ."sites where deleted=0 and id!='70'"; $result = $conn->GetAll($q); $res = 1; $processed_sites = array(); foreach ($result as $s) { $theSite = new Site($s[id]); if (array_key_exists($theSite->htpasswd.$theSite->adp, $processed_sites)) { if($conn->debug) $conn->outp("The member has already been added to this adp_url/htpasswd combination. Check above add commands for SiteID ".$processed_sites[$theSite->htpasswd.$theSite->adp]); continue; } $processed_sites[$theSite->htpasswd.$theSite->adp] = $theSite->id; $res1 = $theSite->addMember($this->username, $this->password); if (! $res1) $res = $res1; unset($theSite); } } return $res; } public function revoke_access() // Otkazva dostap na membera do site-a { global $conn; include_once (CLASSES_PATH."site.class.php"); if ($this->site) { $theSite = new Site($this->site); $res = $theSite->deleteMember($this->username, $this->password); unset($theSite); } else { $q = "select id from ". TBL_PREFIX ."sites"; $result = $conn->GetAll($q); $res = 1; foreach ($result as $s) { $theSite = new Site($s[id]); $res1 = $theSite->deleteMember($this->username, $this->password); if (! $res1) $res = $res1; unset($theSite); } } return $res; } public function activate($sdate,$edate) // aktivira membera (sled uspeshen signup) kato se zadavat start i expiration date // metoda unishtojava saotvetniya pending member i go sazdava nanovo v tablicata s active members // sled koeto mu dava access do members areata na site-a { include_once(CLASSES_PATH."upgradeplus.class.php"); include_once(CLASSES_PATH."mem_defs.class.php"); include_once(CLASSES_PATH."active_members.class.php"); if ($this->status != 'active') { $res = $this->del(); if (!$res) exit; $this->status('active'); $this->sdate = $sdate; $this->edate = $edate; $this->deleted = 0; $this->create(); $countMembers = new cMembers($this, 'ADD'); } else { $this->sdate = $sdate; $this->edate = $edate; $this->deleted = 0; $this->save(); } $res = $this->grant_access(); $uplus_member = new UpgradePlusMember(null,$this->subscription_id); if ($uplus_member->id && $uplus_member->upgrade_date!='0000-00-00') $uplus = new UpgradePlus($uplus_member->upgradeplus_id); if ($uplus_member->id && $uplus_member->upgrade_date!='0000-00-00') $uplus->addMember($this->username,$this->password); $memdefs=new MemDefs(); $memdefs->process_memdefs($this,$action="ADD"); return $res; } public function inactivate() // pri expire se otkazva access na membera do site-a i toy se premestva v tablicata za inactive members { include_once(CLASSES_PATH."upgradeplus.class.php"); include_once(CLASSES_PATH."mem_defs.class.php"); include_once(CLASSES_PATH."active_members.class.php"); if ($this->status != 'inactive') { $res = $this->del(); if (!$res) exit; $this->status('inactive'); $this->create(); $countMembers = new cMembers($this, 'DEL'); } $this->revoke_access(); $uplus_member = new UpgradePlusMember(null,$this->subscription_id); if ($uplus_member->id) $uplus = new UpgradePlus($uplus_member->upgradeplus_id); if ($uplus_member->id) $uplus->deleteMember($this->username); $memdefs=new MemDefs(); $memdefs->process_memdefs($this,$action="DELETE"); } public function cancel() { include_once (CLASSES_PATH."site.class.php"); $already_cancelled = $this->cancelled; if (!$already_cancelled && $this->site>0) { include_once (CLASSES_PATH."stats.class.php"); $this->cancel_date=date("Y-m-d"); $this->save(); $stats = new PrgMemberStats($this); $stats->add_cancel(); } $this->update(array('cancelled' => 1)); $site = new Site($this->site); $transaction = (object) 'transaction'; $transaction->cancelled = "1"; $site->send_postback($transaction, $this); } public function get_transactions_history($member = null) { global $conn,$currency_sign; include_once(FUNCTIONS_PATH."tables_funcs.php"); //this is made permanent below (AND member = '$this->username') /*if(isset($member)) { $member_check = "AND member='$member'"; }*/ $query = " SELECT trn_date, transaction_id, subscription_id, title, CASE WHEN free_trial =1 THEN 'initial free trial' WHEN trial =1 THEN 'initial trial' WHEN full_price =1 THEN 'initial full membership' WHEN conversion =1 THEN 'conversion' WHEN rebill =1 THEN 'rebill' WHEN chargeback =1 THEN 'chargeback' WHEN credit =1 THEN 'credit' END AS trn_type, amount FROM ".TBL_PREFIX."transactions t, mpa3_sites s WHERE s.id = t.site AND member = '$this->username' AND processor = '$this->processor' ORDER BY trn_date"; $result = $conn->GetAll($query); $rows = array(); foreach ($result as $row) { $rows[] = array(date("M jS, Y", strtotime($row[trn_date])),$row[transaction_id],$row[trn_type],$row[title],$row[subscription_id],$currency_sign.$row[amount]); } $xml_container = getXMLContainer(); $titles = array ( $xml_container->table_headers->th_trans_date, $xml_container->table_headers->th_trans_id, $xml_container->table_headers->th_trans_type, $xml_container->table_headers->th_site, $xml_container->table_headers->th_subscription_id, $xml_container->table_headers->th_amount ); // $titles = array('Transaction date', 'Transaction ID', 'Transaction type', 'Amount'); $alignment = array('center','center','left','left','left','right'); return draw_table($rows,array(),$alignment,$titles,null,'450'); } public function find_template($template, $site) { $new_template = preg_replace("/^(.*)(\.html)$/i", "$1", $template).'_'.$this->site.'.html'; if (is_file($new_template)) $template = $new_template; return $template; } public function parse_headers($email_html) { /*//headers can be set at the top of the template like this: {header} Subject: Welcome to Hegre-Art.com! Return-Path: support@hegre-art.com From: "Hegre-Art.com" {/header} */ preg_match_all("/{(header)}([\s\S.]*){\/(header)}/", $email_html, $arr_header); preg_match_all("/([^:]*):(.*)/",$arr_header[2][0], $arr_mail_headers); foreach ($arr_mail_headers[1] as $key=>$value) $this->mailHeaders[trim($value)] = trim($arr_mail_headers[2][$key]); return str_replace($arr_header[0][0], '', $email_html); } public function verify_info_change($properties) { $email = ''; foreach ($this->monitored_fields as $key) { if (isset($properties[$key]) && $this->$key!=$properties[$key]) $email .="$key field changed from '".$this->$key."' to '".$properties[$key]."'\n"; $this->{"old_".$key} = $this->$key; $this->{"new_".$key} = $properties[$key]; } if ($email!='' && $this->ch_details) { $this->message = $email; $this->subject = 'Personal information change'; $this->send_email($this->ch_details_email_template, 1); } } public function send_email($template, $instant = 0) { require_once(CLASSES_PATH."mail_to_db.class.php"); @include(CONFIG_PATH."payout_config.php"); $email_html = @implode("", @file($this->find_template(OUTER_TEMPLATES_PATH.$template))); if ($this->minimum_email_length>strlen($email_html)) return 0; $this->program_name = PROGRAM_NAME; $this->members_support_email = $members_support_email; $this->subject = $this->subject." for ".PROGRAM_NAME; $asArray = get_object_vars($this); foreach($asArray as $field=>$value) $email_html = str_replace('{'.$field.'}', $this->$field, $email_html); $email_html = $this->parse_headers($email_html); if ($this->mailHeaders['From']=='' && $this->mailHeaders['from']=='') $this->mailHeaders['From'] = "$webmasters_support_email"; if ($this->mailHeaders['Subject']!='' || $this->mailHeaders['subject']!='') $this->subject = $this->mailHeaders['Subject'].$this->mailHeaders['subject']; foreach ($this->mailHeaders as $key=>$value) if (!preg_match("/subject|from/i", $key)) $mailHeader .="$key: $value\n"; $mailHeader = "From: ".$this->mailHeaders['From'].$this->mailHeaders['from']."\n".$mailHeader; if ($instant) { mail("\"$this->fname $this->lname\" <$this->email>", $this->subject, $email_html,"$mailHeader"."Content-type: text/html; charset=iso-8859-1\nX-Priority: 1"); } else { $mailHeader = preg_replace("/from:\s*/i", '', $mailHeader); $mail = new MailDB("\"$this->fname $this->lname\" <$this->email>", $this->subject, $email_html,"$mailHeader"."X-Priority: 1",time()); } } } ?> //hostname_check class MailDB { function MailDB($address,$subject,$message,$headers,$mail_id,$content_type='html',$cc='',$bcc='',$mime="MIME-Version: 1.0\n") { $c_type = array('html' => "Content-type: text/html; charset=iso-8859-1\n", 'text' => "Content-type: text/plain; charset=iso-8859-1\n"); $this->address = $address; if (!preg_match("/from: /i", $headers)) $this->headers = "From: $headers\n"; else $this->headers = "$headers\n"; $this->subject = $subject; $this->message = $message; $this->mime = $mime; $this->content_type = $c_type[$content_type]; if ($cc) $this->cc = "CC: $cc\n"; if ($bcc) $this->bcc = "BCC: $bcc\n"; $this->headers = $this->mime.$this->content_type.$this->headers.$this->cc.$this->bcc; $this->mail_id = $mail_id; $this->save(); } function save() { global $conn; $sql = "SELECT * FROM ".TBL_PREFIX."to_send WHERE id = -1"; $result = $conn->Execute($sql); if ($conn->no_autoincrement) $this->id = $conn->GenID("seq_".TBL_PREFIX."to_send",1); $insertSQL = $conn->GetInsertSQL($result, get_object_vars($this)); $conn->Execute($insertSQL); if (! $this->id) {$this->id = $conn->Insert_ID();} } } ?> Retrieve Lost Password RETRIEVE LOST PASSWORD retrieve lost password Please fill in at least two entries! UserName Subscribtion ID Email Address
retrieve lost password
Please fill in at least two entries!