Subversion Repositories SmartDukaan

Rev

Rev 3090 | Rev 3269 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3090 mandeep.dh 1
/**
2
 * 
3
 */
4
package in.shop2020.serving.controllers;
5
 
6
import org.apache.shiro.SecurityUtils;
7
import org.apache.shiro.crypto.hash.Sha256Hash;
8
import org.apache.struts2.convention.annotation.Result;
9
import org.apache.thrift.TException;
10
 
11
/**
12
 * @author mandeep
13
 * This class manages all the login related updates for a user.
14
 */
15
@Result(name="loginPage", location="/login.html")
16
public class LoginController extends BaseController {
17
 
18
    /**
19
     * 
20
     */
21
    private static final long serialVersionUID = 1L;
22
 
23
    private String password; 
24
 
25
    public String updatePassword() throws TException
26
    {
27
        createServiceClients();
28
        crmServiceClient.updatePasswordForAgent(currentAgentEmailId, new Sha256Hash(password).toHex());
29
        addActionMessage("Password changed successfully!");
30
        return INPUT;
31
    }
32
 
33
    public String logout()
34
    {
35
        log.info("Logging out!");
36
        SecurityUtils.getSubject().logout();
37
        return "loginPage";
38
    }
3106 mandeep.dh 39
 
40
    public String getPassword() {
41
        return password;
42
    }
43
 
44
    public void setPassword(String password) {
45
        this.password = password;
46
    }
3090 mandeep.dh 47
}