Permalink
Browse files

Password validation logic added

  • Loading branch information...
1 parent 45f61ff commit dfc0ace7b923b5c4a8cfbd551ba768335c7edd47 @psibi psibi committed Feb 25, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 client.py
View
@@ -15,7 +15,6 @@
#!/usr/bin/python
import mechanize
import cookielib
-from time import sleep
br=mechanize.Browser()
@@ -38,9 +37,13 @@ def authenticate_site(self,user,pword):
br.form['password']=pword
br.submit()
s = br.geturl()
+ #Check for Valid password here
+ if s.find('Login') != -1:
+ return False #returns false on password error
link = s.split("?")
self.id = link[1]
-
+ return True
+
def open_sendpage(self):
action="SendSMS"
s = self.get_weburl(action)
@@ -76,5 +79,3 @@ def get_weburl(self,action):
#client.authenticate_site('7200120343','xxx')
#client.send_sms('9487847594',"Hello World)
#client.logout()
-
-

0 comments on commit dfc0ace

Please sign in to comment.