[Improve cc payments identity checks Adrian Georgescu **20100320122410] hunk ./library/sip_settings.php 1834 + $this->showIdentityProof(); + hunk ./library/sip_settings.php 1864 - if ($_FILES['tmpfile']['tmp_name'] && $_REQUEST['name'] && is_numeric($_REQUEST['last_digits'])) { + if ($_REQUEST['task'] == 'upload') { + if (!$_FILES['tmpfile']['tmp_name']) { + print ""; + printf (_("Error: Please specify a file")); + print ""; + + } else if (!$_REQUEST['name']) { + print ""; + printf (_("Error: Please enter the name printed on the Credit Card")); + print ""; + + } else if (!preg_match("/^\d{4}$/",$_REQUEST['last_digits'])) { + print ""; + printf (_("Error: Last digits must be numeric")); + print ""; + + } else if (!preg_match("/^\+[1-9][0-9]{7,14}$/",$_REQUEST['mobile_number'])) { + + print ""; + printf (_("Error: Mobile Number must be in international format starting with +")); + print ""; + + } else if ($_FILES['tmpfile']['size']['size'] > $max_file_size) { + print ""; + printf (_("Error: Maximum file size is %s"),$max_file_size); + print ""; + + } else { hunk ./library/sip_settings.php 1893 - if ($_FILES['tmpfile']['size']['size'] < $max_file_size) { - hunk ./library/sip_settings.php 1907 - `last_digits` + `last_digits`, + `mobile_number` hunk ./library/sip_settings.php 1919 + '%s', hunk ./library/sip_settings.php 1929 - addslashes($_REQUEST['last_digits']) + addslashes($_REQUEST['last_digits']), + addslashes($_REQUEST['mobile_number']) hunk ./library/sip_settings.php 1964 - - } else { - print ""; - printf (_("Error: Maximum file size is %s"),$max_file_size); - print ""; hunk ./library/sip_settings.php 2004 - print "

"; - print _("Credit Card payments will be activated after your identity is verified. "); + if (!in_array("payments",$this->groups)) { + print "

"; + print _("Credit Card payments will be activated after your identity is verified. "); + } hunk ./library/sip_settings.php 2013 - printf ("%s%s%s%s%s%s", + printf ("%s%s%s%s%s%s%s", hunk ./library/sip_settings.php 2019 - _("Last digits") + _("Last digits"), + _("Mobile Number") hunk ./library/sip_settings.php 2035 - printf (" %s%s %s %s KB %s%s", + printf (" %s%s %s %s KB %s%s%s", hunk ./library/sip_settings.php 2042 - $this->db->f('last_digits') + $this->db->f('last_digits'), + $this->db->f('mobile_number') hunk ./library/sip_settings.php 2095 - printf ("",$_REQUEST['name']); + printf ("",$_REQUEST['name']); hunk ./library/sip_settings.php 2114 + + print " + + "; + print _("Mobile Number"); + print " + + + "; + printf(" %s",$_REQUEST['mobile_number'],_("International format starting with +")); hunk ./library/sip_settings.php 2125 + print " + + + "; + hunk ./library/sip_settings.php 3599 + if ($mobile_number && !preg_match("/^\+/",$mobile_number)) { + $mobile_number='+'.$mobile_number; + } + hunk ./library/sip_settings.php 4759 - if ($dial_suffix > 0) { - printf (_("Prefix to auto-complete short numbers"),$dial_suffix); - } hunk ./library/sip_settings.php 4760 + printf (_("Prefix to auto-complete short numbers"),$dial_suffix); hunk ./library/sip_settings.php 4770 - if ($this->SOAPversion <= 1) return; - if (!in_array("free-pstn",$this->groups)) return; - hunk ./library/sip_settings.php 4777 - + %s hunk ./library/sip_settings.php 4780 - ",$this->Preferences['mobile_number']); - + ",$this->Preferences['mobile_number'],_("International format starting with +")); hunk ./setup/mysql/alter_tables.mysql 667 + `mobile_number` varchar(15) NOT NULL, hunk ./setup/mysql/create_tables.mysql 654 + `mobile_number` varchar(15) NOT NULL,