Пример #1
0
 def request_code(self, cr, uid, ids, context=None):
     result = {}
     for move in self.browse(cr, uid, ids, context=context):
         method = move.request_code
         if method not in ("sms", "voice"):
             return self.pool.get('warning_box').info(cr,
                                                      uid,
                                                      title='Request Phone',
                                                      message='error')
         else:
             identity = move.idphone
             identity = Utilities.processIdentity(identity)
             countryCode = move.cc
             login = move.phone
             phoneNumber = login[len(countryCode):]
             wc = WACodeRequestV2(countryCode, phoneNumber, identity,
                                  method)
             result = wc.send()
             result = resultToString(
                 result
             ) + "\n" + "https://coderus.openrepos.net/whitesoft/whatsapp_sms"
             return self.pool.get('warning_box').info(cr,
                                                      uid,
                                                      title='REquest Phone',
                                                      message=result)
     return self.pool.get('warning_box').info(cr,
                                              uid,
                                              title='Request Phone',
                                              message='error')
Пример #2
0
 def register(self, cr, uid, ids, context=None):
     result = {}
     for move in self.browse(cr, uid, ids, context=context): 
         code = move.register_code
         code = "".join(code.split('-'))
         identity = move.idphone
         identity = Utilities.processIdentity(identity)
         countryCode = move.cc
         login = move.phone
         phoneNumber = login[len(countryCode):]
         wr = WARegRequestV2(countryCode, phoneNumber, code, identity)
         result = wr.send()
         result = resultToString(result)
     return self.pool.get('warning_box').info(cr, uid, title='Register Phone', message=result)
Пример #3
0
 def test_exists(self, cr, uid, ids, context=None):
     for move in self.browse(cr, uid, ids, context=context):
         identity = move.idphone
         identity = Utilities.processIdentity(identity)
         
         countryCode = move.cc
         login = move.phone
         phoneNumber = login[len(countryCode):]
         
         we = WAExistsRequestV2(countryCode, phoneNumber, identity)
         result = we.send()
         print(resultToString(result))
 
         if result["pw"] is not None:
             print("\n=========\nWARNING: %s%s's has changed by server to \"%s\", you must update your config file with the new password\n=========" %(countryCode, phoneNumber, result["pw"]))
Пример #4
0
 def register(self, cr, uid, ids, context=None):
     result = {}
     for move in self.browse(cr, uid, ids, context=context):
         code = move.register_code
         code = "".join(code.split('-'))
         identity = move.idphone
         identity = Utilities.processIdentity(identity)
         countryCode = move.cc
         login = move.phone
         phoneNumber = login[len(countryCode):]
         wr = WARegRequestV2(countryCode, phoneNumber, code, identity)
         result = wr.send()
         result = resultToString(result)
     return self.pool.get('warning_box').info(cr,
                                              uid,
                                              title='Register Phone',
                                              message=result)
Пример #5
0
    def test_exists(self, cr, uid, ids, context=None):
        for move in self.browse(cr, uid, ids, context=context):
            identity = move.idphone
            identity = Utilities.processIdentity(identity)

            countryCode = move.cc
            login = move.phone
            phoneNumber = login[len(countryCode):]

            we = WAExistsRequestV2(countryCode, phoneNumber, identity)
            result = we.send()
            print(resultToString(result))

            if result["pw"] is not None:
                print(
                    "\n=========\nWARNING: %s%s's has changed by server to \"%s\", you must update your config file with the new password\n========="
                    % (countryCode, phoneNumber, result["pw"]))
Пример #6
0
 def request_code(self, cr, uid, ids, context=None):
     result = {}
     for move in self.browse(cr, uid, ids, context=context): 
         method = move.request_code
         if method not in ("sms","voice"):
             return self.pool.get('warning_box').info(cr, uid, title='Request Phone', message='error')   
         else:
             identity = move.idphone
             identity = Utilities.processIdentity(identity)
             countryCode = move.cc
             login = move.phone
             phoneNumber = login[len(countryCode):]
             wc = WACodeRequestV2(countryCode, phoneNumber, identity, method)
             result = wc.send()
             result = resultToString(result) + "\n" + "https://coderus.openrepos.net/whitesoft/whatsapp_sms"
             return self.pool.get('warning_box').info(cr, uid, title='REquest Phone', message=result)
     return self.pool.get('warning_box').info(cr, uid, title='Request Phone', message='error')