Package ecks.services

Examples of ecks.services.SrvAuth_user


    }

    public void handle_command(Service who, String user, String replyto, String arguments) {
        if (((SrvAuth) who).getUsers().containsKey(arguments.toLowerCase())) {

            SrvAuth_user t = ((SrvAuth) who).getUsers().get(arguments.toLowerCase());
            Generic.curProtocol.outNOTICE(who, user, "\u0002Username:\u0002 " + arguments);
            Generic.curProtocol.outNOTICE(who, user, "\u0002---------\u0002 ");
            Generic.curProtocol.outNOTICE(who, user, "Access Level: " + t.getAccess());

            if (t.getAllMeta().containsKey("_ts_registered"))
                Generic.curProtocol.outNOTICE(who, user, "Registered On: " + DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(new Date(Integer.parseInt(t.getMeta("_ts_registered")) * 1000L)));
            else
                Generic.curProtocol.outNOTICE(who, user, "Unknown Registration Date.");

            if (t.getAllMeta().containsKey("_ts_last"))
                Generic.curProtocol.outNOTICE(who, user, "Last Seen On: " + DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(new Date(Integer.parseInt(t.getMeta("_ts_last")) * 1000L)));
            else
                Generic.curProtocol.outNOTICE(who, user, "Has never logged in.");

            if (t.getAllMeta().containsKey("staffnote"))
                Generic.curProtocol.outNOTICE(who, user, "Staff Note: " + t.getMeta("staffnote"));
            else
                Generic.curProtocol.outNOTICE(who, user, "Has no staff note.");

            if (t.getAllMeta().containsKey("cookie")) {
                Generic.curProtocol.outNOTICE(who, user, "Has a cookie");
                if (util.checkaccess(user, CommandDesc.access_levels.A_HELPER.ordinal()))
                    Generic.curProtocol.outNOTICE(who, user, "Cookie: " + t.getMeta("cookie"));
            }

            if (t.WhereAccess.size() == 0)
                Generic.curProtocol.outNOTICE(who, user, "Has no access to any channel");
            else
View Full Code Here


                        if (util.sanitize(pw)) {
                            pw = util.hash(pw);
                            String e = args[2];
                            if (util.checkemail(e)) {
                                if (!(temp.getUsers().size() == 0)) {
                                    temp.getUsers().put(u, new SrvAuth_user(u, pw, e, CommandDesc.access_levels.A_PENDING));
                                    Generic.Users.get(user).authhandle = u.trim().toLowerCase(); // user is now authed
                                    Generic.curProtocol.srvSetAuthed(who, user, ((long) -1)); // new users don't have svsids
                                    String tCookie = util.makeCookie();
                                    temp.getUsers().get(u).setMeta("cookie", tCookie);
                                    temp.getUsers().get(u).setMeta("_ts_registered", util.getTS());
                                    temp.getUsers().get(u).setMeta("_ts_last", util.getTS());
                                    util.SendRegMail(e, tCookie);
                                    Generic.curProtocol.outPRVMSG(who, replyto, "\u0002" + Generic.Users.get(user).uid + ":\u0002 Registration Succeeded!");
                                } else { // first registration is an SRA
                                    temp.getUsers().put(u, new SrvAuth_user(u, pw, e, CommandDesc.access_levels.A_SRA));
                                    Generic.Users.get(user).authhandle = u.trim().toLowerCase(); // user is now authed
                                    temp.getUsers().get(u).setMeta("_ts_registered", util.getTS());
                                    temp.getUsers().get(u).setMeta("_ts_last", util.getTS());
                                    Generic.curProtocol.outPRVMSG(who, replyto, "\u0002" + Generic.Users.get(user).uid + ":\u0002 Registration Succeeded! You are now an SRA!");
                                }
View Full Code Here

        SrvAuth auth = (SrvAuth)Configuration.getSvc().get(Configuration.authservice);

        if (!auth.getUsers().containsKey(username.toLowerCase()))
            return 0;

        SrvAuth_user u = auth.getUsers().get(username.toLowerCase());
        return u.getAccess().ordinal();
    }
View Full Code Here

                if (Math.abs(Generic.Users.get(user).svsid) == Long.parseLong(args[0])) { // if there is a svsid
                    Logging.verbose("SRVREAUTH", "Has correct svsid! " + args[0]);
                    String uname = temp.dbMap.get(Long.parseLong(args[0]));
                    if (temp.Users.containsKey(uname)) { // if uname associated with svsid is valid
                        Logging.verbose("SRVREAUTH", "Uname associated with svsid! " + uname);
                        SrvAuth_user t = temp.Users.get(uname);
                        Logging.verbose("SRVREAUTH", "Uname has svsid! " + t.getMeta("svsid"));
                        if (t.getMeta("svsid").equals(args[0])) // if the username thinks it has the same svsid as the svsid thinks it has username
                        {
                            Logging.verbose("SRVREAUTH", "Should auth!");
                            Generic.Users.get(user).authhandle = uname;

//todo: fill a queue
View Full Code Here

TOP

Related Classes of ecks.services.SrvAuth_user

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.