I dont know how to go about defining a set of attributes to a user when they have logged in to Apex. After logging in with their username and password, the tables should display data about that User. The username and password are stored in a table with general details such as 'name','email address','home address etc' with 'Employee_id' being the primary key. When they have logged in they should have that specific row's data values. What I have tried to attempt:
I made a report want to specify the name display:
SELECT NAME
FROM EMPLOYEES
WHERE EMPLOYEE_USERNAME= :APP_USER
(Have tried to get the current logged in username).
This has not worked and nothing is displayed.
For your above query to return data the value of EMPLOYEE_USERNAME must match the current username which is stored in the :APP_USER variable. Please note that :APP_USER retrieves the username of the current user in uppercase. I suggest you change your query like this:
SELECT NAME
FROM EMPLOYEES
WHERE UPPER(EMPLOYEE_USERNAME)= :APP_USER
This type of query has some performance problems i suggest adding a trigger that will ensure the EMPLOYEE_USERNAME is in a uppercase or add a Function Based Index on UPPER(EMPLOYEE_USERNAME).
Related
We have a table that contains a user's email address, their first name and last name and some date columns. The standard search works great for those.
I would like to provide a way of the user being searchable by their user id which is a GUID. The user id is not a visible piece of data. This search would really only be used by admins
I know I could use the data-search attribute on the user name column e.g.
data-search="43b30438-e3c8-4e27-8b31-5fcc52e53a3b me#test.com"
However that makes that row and any other row findable with just the number "43" as that GUID starts with 43 or "52" because it has a 5 followed by an 2. That is clearly not what I want. How do I make the users searchable by their GUID as well as their username but in the case of the GUID only when it is the whole GUID being searched for?
Thanks
Sql question.
I have a customer table with:
User id, name, email, phone
The customer can update their name, email and phone at anytime on an app.
How can I find out which user id had changes in name, email or phone number on a particular date?
Since your table doesn't store the date that they made the changes, you can't.
If you add a column with a datetime type (or whatever your specific database product provides) - you could call it LastModified or something like that - then the solution becomes trivial.
I'd give you a specific example, but because you didn't tell us what database engine you use, I can't guarantee to get the syntax right.
This is an issue with RDBMSes, you cannot as they generally store say a "photograph" of your data in time not a "film" of how it got there.
Based on the RDBMS you use, you can introduce an updated_at field which will hold when the last change happened to that row either from the "UPDATE" statement (say 'UPDATE phone=000, updated_at=now() WHERE user_id=999') or set it up to autoupdate see: create column for auto-date in postgresql
I am trying to get a list of users who have access to a particular issue.
I tried using GET /rest/api/2/user/viewissue/search for this . But it asks for username and issueKey query parameters. Also it is returning only one user.
How does this api work?
I refered to the documentation here: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-user-viewissue-search-get
EDIT to the below: If you query with username=% (i.e. a wildcard) then it returns
every user with permission
As the documentation you've linked to states, you do need to provide an issueKey and a username or it won't return any results:
username
string
the username filter, no users returned if left blank
This is saying, find all the users who have permission to see the specified issue, where their username matches this specific filter value I'm providing, i.e. not all users that have permission.
It's filtering on some combination of username, display name and email (I think).
I have a JIRA Cloud site with three users:
admin, which has a display name of Mike Jones and an email of mike.jones#...
mike, which has a display name of Mike Jones and an email of mike.jones#...
mike.jones, which has a display name of Mike Smith and an email of mike.jones#...
If I run this query, I see all three users returned:
https://<url>/rest/api/2/user/viewissue/search?issueKey=DD-1&username=mike
If I change the last query parameter to be username=smith then I see just the third user with a display name of Mike Smith, which suggests it's querying the Display Name field:
https://<url>/rest/api/2/user/viewissue/search?issueKey=DD-1&username=smith
But if I use the parameter username=jones, then I see all three users, which suggests it's querying the Email field:
https://<url>/rest/api/2/user/viewissue/search?issueKey=DD-1&username=jones
And if I use the parameter username=admin, then I only see the admin user, which suggests it's querying on the Username field:
https://<url>/rest/api/2/user/viewissue/search?issueKey=DD-1&username=admin
How to create a dynamic attribute in lov at runtime?
Suppose I have a employee lov, where only two attributes are currently present like employee id and employee name.
It user want to add a few more column at run time like employee age and employee salary.
Without changing the LOV logic. The user has one master table where IT user can handle how many attribute should be displayed to business user. They can add a new parameter in table which can be displayed.
Can anybody suggest me some approach to handle this type of scenario?
If I got you right, I'd use backingBean with method that returns List, that implemented as ArrayList<SelectItem>. Then populate from any source(like VO, or whatever mixed) label and value according to your current user request.
My objective is to create a table that stores the information of the users and their passwords. Also, I want to keep track the number of failed logins. However, Here is a brief description about the tables:
First: the table of users
UserNo: ID of the user
Name: user's name
Email
Second: the table of login
UserNo: is the same as the last one
Password
Third: the table of tracking
UserNo
DateTime: date and time of login
count: counter that increases every time the user logins incorrectly.
From the last three tables, I do not think what I have done is a professional way. Is there any better ideas? especially with the tracking table.
Thanks
A couple of points:
There's no reason for your second table unless you're going to keep a password history (in which case you need an additional field to track the date the password was created)
In the third table, don't use a counter for the number of incorrect logins; instead, write a record for every login attempt (successful or otherwise), and use a query to retrieve the count whenever you need it.
Why are you keeping them separate? Why not just have a users table with the id, username, password hash, last login date and failed attempts counter?
Otherwise you could separate out login attempts to it's own table and record a status e.g. SUCCESS or FAIL so you can procedurally calculate number of failed attempts since the last successful one, and it also provides a full audit of logins, failed or not.
You might want to merge the first two tables together, as there is only one password per user, so it makes sense to have all the data for a user on one row in one table.
The third table records the timestamp of each login, and could also record the timestamp of each failed login if you added an extra column, then a quesy will give you a count of total failed logins per user.
Or, if you are counting the number of failed logins since last login, then you could just put the counter in the first table again.
You can put all your fields in a single table
UserID, UserName, UserEmail, Password, Login_Timestamp, Counter
then you can save all the values in a single table