Subversion Repositories SmartDukaan

Rev

Rev 2358 | Rev 3086 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2358 Rev 2445
Line 3... Line 3...
3
 
3
 
4
@author: ashish
4
@author: ashish
5
'''
5
'''
6
from shop2020.helpers.impl import DataAccessor
6
from shop2020.helpers.impl import DataAccessor
7
from shop2020.helpers.impl.DataAccessor import getSubstitutedMessage, getMessage,\
7
from shop2020.helpers.impl.DataAccessor import getSubstitutedMessage, getMessage,\
8
    updateMessage, addMessage, add_user, authenticate_user, delete_user, update_password,\
8
    updateMessage, addMessage, add_user, delete_user, update_password,\
9
    save_user_email_for_sending, get_emails_to_be_sent, mark_email_as_sent , initialize, close_session,\
9
    save_user_email_for_sending, get_emails_to_be_sent, mark_email_as_sent , initialize, close_session,\
10
    get_reports
10
    get_reports, authenticate_dashboard_user
11
from shop2020.helpers.impl.DataService import LogisticsUser, StatisticsUser,\
11
from shop2020.helpers.impl.DataService import LogisticsUser, StatisticsUser,\
12
    ReportUser, CatalogDashboardUser
12
    ReportUser, CatalogDashboardUser
13
from shop2020.thriftpy.utils.ttypes import HelperServiceException
13
from shop2020.thriftpy.utils.ttypes import HelperServiceException
14
from shop2020.helpers.impl.Converters import to_t_luser, to_t_useremail,\
14
from shop2020.helpers.impl.Converters import to_t_luser, to_t_useremail,\
15
    to_t_suser, to_t_ruser, to_t_report, to_t_catalog_user
15
    to_t_suser, to_t_ruser, to_t_report, to_t_catalog_user
Line 126... Line 126...
126
        try:
126
        try:
127
            return delete_user(username)
127
            return delete_user(username)
128
        finally:
128
        finally:
129
            close_session()
129
            close_session()
130
                
130
                
131
    def authenticateUser(self, username, password):
131
    def authenticateDashboardUser(self, username, password):
132
        """
132
        """
-
 
133
        Returns the dashboard user if the supplied username and password match. Raises an exception otherwise.
-
 
134
        The loggedOn timestamp for the dashboard user is updated .
-
 
135
        
133
        Parameters:
136
        Parameters:
134
         - username
137
         - username
135
         - password
138
         - password
136
        """
139
        """
137
        try:
140
        try:
138
            return authenticate_user(username, password)
141
            return authenticate_dashboard_user(username, password)
139
        finally:
142
        finally:
140
            close_session()
143
            close_session()
141
            
144
            
142
    
145
    
143
    def updatePassword(self, username, oldPassword, newPassword):
146
    def updatePassword(self, username, oldPassword, newPassword):