Exemple #1
0
    def register_login(class_, username, session, request):
        user = db.query(AdminUser).filter(AdminUser.username==username).first()
        if user:
            now = datetime.now()
            user.last_login = now
            user.session_id = session.id
            user.remote_addr = request.environ["HTTP_REMOTE_EU"]
            db.commit()
            db.flush()

        db.remove()
Exemple #2
0
    def register_login(class_, username, session, request):
        user = db.query(AdminUser).filter(
            AdminUser.username == username).first()
        if user:
            now = datetime.now()
            user.last_login = now
            user.session_id = session.id
            user.remote_addr = request.environ["HTTP_REMOTE_EU"]
            db.commit()
            db.flush()

        db.remove()
Exemple #3
0
 def get_email_account(self):
     email = db.query(EmailAccount).filter(EmailAccount.user_id==self.id).first()
     if email:
         return email
Exemple #4
0
 def get_customer_name(class_, customer_id):
     customer = db.query(Customer).filter(Customer.id==customer_id).first()
     if customer:
         return customer.name
Exemple #5
0
 def get_groups(self):
     return db.query(Group.name).join(UserGroup).filter(UserGroup.user_id==self.id).all()
Exemple #6
0
 def get_context(self):
     co = db.query(Customer).filter(Customer.id==self.customer_id).first()
     return co.context
Exemple #7
0
 def has_call_center(self):
     co = db.query(Customer).filter(Customer.id==self.customer_id).first()
     return co.has_call_center
Exemple #8
0
 def get_gateway(self):
     gw = db.query(PbxContext.gateway).join(Customer).join(User).filter(
         User.customer_id == Customer.id).first()
     return 0 if not gw else gw[0]
Exemple #9
0
 def get_gateways(self):
     return Session.query(PbxGateway).filter_by(pbx_profile_id=self.id)
Exemple #10
0
 def get_gateways(self):
     return Session.query(PbxGateway).filter_by(pbx_profile_id=self.id)
Exemple #11
0
 def get_email_account(self):
     email = db.query(EmailAccount).filter(
         EmailAccount.user_id == self.id).first()
     if email:
         return email
Exemple #12
0
 def get_customer_name(class_, customer_id):
     customer = db.query(Customer).filter(
         Customer.id == customer_id).first()
     if customer:
         return customer.name
Exemple #13
0
 def get_groups(self):
     return db.query(Group.name).join(UserGroup).filter(
         UserGroup.user_id == self.id).all()
Exemple #14
0
 def get_context(self):
     co = db.query(Customer).filter(Customer.id == self.customer_id).first()
     return co.context
Exemple #15
0
 def has_call_center(self):
     co = db.query(Customer).filter(Customer.id == self.customer_id).first()
     return co.has_call_center
Exemple #16
0
 def by_domain(self, domain=None):
     return Session.query(PbxContext).filter_by(domain=domain).first()
Exemple #17
0
 def index(self, category):
     return db.query(Help)
Exemple #18
0
 def get_gateway(self):
     gw = db.query(PbxContext.gateway).join(Customer).join(User).filter(User.customer_id==Customer.id).first()
     return 0 if not gw else gw[0]
Exemple #19
0
 def by_domain(self, domain=None):
     return Session.query(PbxContext).filter_by(domain=domain).first()
Exemple #20
0
 def index(self, category):
     return db.query(Help)