Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Yasinsky committed Mar 5, 2013
1 parent daf75cb commit 90d0e9e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
3 changes: 2 additions & 1 deletion mail.oopzy.com/code/var/mail.oopzy.com/app/views/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@
save_3:'Forward all emails from:',
save_4:'to this email.',
whycare:'why care?',
initbox: 'Enter Your Mail'
initbox: 'Enter Your Mail',
invalidfirst:'1st must be alfa numeric'
};


Expand Down
27 changes: 16 additions & 11 deletions mail.oopzy.com/code/var/mail.oopzy.com/assets/vendor/oopzy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@ function checkStrength(str){

var strength = 0;
var res = '';


var p = str.charAt(0);
debug(p);
//if it has one special character, increase strength str
if (p.match(/([!,%,&,@,#,$,^,*,?,_,~])/)){
return 'invalidfirst'; //invalid first char
}

if(!isValidEmail(str + '@domain.com'))
{
return 'invalid';
}

//if the password length is less than 6, return message.
if (str.length < 6) {
res = 'too_short';
Expand All @@ -11,10 +23,10 @@ function checkStrength(str){

//length is ok, lets continue.

//if length is 8 characters or more, increase strength str
if (str.length > 7){
if (str.length > 5){
strength += 1;
}


//if password contains both lower and uppercase characters, increase strength str
if (str.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)){
Expand All @@ -39,21 +51,14 @@ function checkStrength(str){
//now we have calculated strength str, we can return messages

//if str is less than 2
if (strength < 2 ) {
if (strength < 2 ) {
res = 'bad';
} else if (strength == 2 ) {
res = 'lousy';
} else {
res = 'good';
}

if(!isValidEmail(str + '@domain.com'))
{
$(out).removeClass();
$(out).addClass('weak');
res = 'invalid';
}

return res;
}

Expand Down
2 changes: 1 addition & 1 deletion mail.oopzy.com/code/var/mail.oopzy.com/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
$GLOBALS['site_name']='oopzy spam fighter single use recycle email';
$GLOBALS['jsdebug'] = true;
$GLOBALS['namespace'] = 'oopzy';
$GLOBALS['cache_param'] = 5;
$GLOBALS['cache_param'] = 8;

$GLOBALS['allowed_hosts'] = array('oopzy.com');
$GLOBALS['host_name'] = 'oopzy.com';
Expand Down

0 comments on commit 90d0e9e

Please sign in to comment.