Sponsored Content
The Lounge What is on Your Mind? Which category do you belong to? Post 302988820 by rbatte1 on Tuesday 3rd of January 2017 09:52:51 AM
Old 01-03-2017
Could I add a few suggestions (in no particular order):-
  • Student with aspirations in the support side of IT
  • Admin who sits firmly on the hardware side
  • Admin who looks to script everything
  • Admin who is also DBA
  • Admin who is everything except end-user application development
  • Admin converted from mainframe
  • Operator looking to automate to keep on top of every growing workloads
  • Specialist in a non-IT field, but having to Admin own server, e.g. scientist, legal support, education, financial advisor etc.

I'm here somewhere, I'm sure Smilie


Robin
These 2 Users Gave Thanks to rbatte1 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

listing files that do not belong to current date

How do we list all the file names in a directory that does not belong to current date. (1 Reply)
Discussion started by: esh.mohan
1 Replies

2. UNIX for Dummies Questions & Answers

listing files that does not belong to current date

How do we list all the file names in a directory that does not belong to current date. (3 Replies)
Discussion started by: esh.mohan
3 Replies

3. Post Here to Contact Site Administrators and Moderators

How to change the category?

Hi, I submitted my blog on UNIX in the links section. On submitting, i chose the category as Unix/Linux standards, which i now feel is incorrect. I would like to change the category of my link, but i don't find any option to change the category. Please help me in doing the needful. Thanks... (7 Replies)
Discussion started by: guruprasadpr
7 Replies

4. Shell Programming and Scripting

Split file into given category and others using awk

Hi All, Would it be possible using awk to split a given file into two files based on a certain condition such that one output file will contain all lines that fit the condition while the other output file will contain lines that did not fit the condition? Here is a sample input file ... (6 Replies)
Discussion started by: cympaulife
6 Replies

5. Shell Programming and Scripting

Listing files that belong to a certain year date?

I'm trying to list files, first by size and I'm using something like this ls -l|awk '{print $5,$6,$7,$8,$9|"sort -nr"}'|more Now I'd like to just do the same listing but only for files with the year 2009 in the $8 field or even anything less than 2011. (5 Replies)
Discussion started by: NycUnxer
5 Replies

6. Shell Programming and Scripting

extract the max value category

Hi, I have a file and I want the category for each row to be its highest value. gene highest medium lower lowest ABC 20 30 50 70 DEF 90 20 60 0 o/p gene highest medium lower lowest category ABC... (6 Replies)
Discussion started by: Diya123
6 Replies

7. UNIX for Dummies Questions & Answers

ldap , search groups that user belong

i want run query to identify witch groups that user A belong, CN=name,CN=Users,DC=mydomain ?? (1 Reply)
Discussion started by: prpkrk
1 Replies

8. Shell Programming and Scripting

Data filtering and category assigning

Please consider the following file, I have many groups which can be of 3 types, T1 (Serial_Number 1) T2 (Serial_Number 2) and T1*T2 (all other Serial_Number). I want to only consider groups that have both T1 and T2 present and their values are different from each other. In the example file,... (8 Replies)
Discussion started by: jianp83
8 Replies

9. Shell Programming and Scripting

Category and count with awk

I want to categorize and count the as below: Input file: A1 G1 C1 F1 A2 G1 C1 F1 A3 G1 C1 F2 A4 G1 C2 F2 A7 G1 C2 F2 A8 G1 C2 F3 A11 G1 C2 F3 A23 G1 C2 F3 B4 G1 C2 F3 AC4 G2 C3 F4 B6 G2 C4 F4 BB5 G2 C4 F4 A25 G2 C5 F4 B13 G2 C5 F5 D12 G2 C5 F5 D2 G2 C5 F5 (3 Replies)
Discussion started by: aydj
3 Replies

10. UNIX for Beginners Questions & Answers

Delete records that do not belong to that day

i have a requirement to delete records that do not belong to that day. For example in a file that came on July 31st ,2018 there are records that belong to Aug 1st,2018 as well and I want to find and delete those records. I want to delete anything with 01-Aug-2018. I have several files like that. I... (6 Replies)
Discussion started by: Priya
6 Replies
User::Simple::Admin(3pm)				User Contributed Perl Documentation				  User::Simple::Admin(3pm)

NAME
User::Simple::Admin - User::Simple user administration SYNOPSIS
$ua = User::Simple::Admin->new($db, $user_table); $ua = User::Simple::Admin->create_rdbms_db_structure($db, $user_table, [$extra_sql]); $ua = User::Simple::Admin->create_plain_db_structure($db, $user_table, [$extra_sql]); $ok = User::Simple::Admin->has_db_structure($db, $user_table); %users = $ua->dump_users; $id = $ua->id($login); $login = $ua->login($id); $otherattrib = $user->otherattrib($id); $ok = $usr->set_login($id, $login); $ok = $usr->set_passwd($id, $passwd); $ok = $usr->set_otherattrib($id, $value); $ok = $usr->clear_session($id); $id = $ua->new_user(login => $login, passwd => $passwd, [otherattribute => $otherattribute]); $ok = $ua->remove_user($id); DESCRIPTION
User::Simple::Admin manages the administrative part of the User::Simple modules - Please check User::Simple for a general overview of these modules and an explanation on what-goes-where. User::Simple::Admin works as a regular administrator would: The module should be instantiated only once for all of your users' administration, if possible, and not instantiated once for each user (in contraposition to User::Simple, as it works from each of the users' perspective in independent instantiations). Note also that User::Simple::Admin does b<not> perform the administrative user checks - It is meant to be integrated to your system, and it is your system which should carry out all of the needed authentication checks. CONSTRUCTOR Administrative actions for User::Simple modules are handled through this Admin object. To instantiate it: $ua = User::Simple::Admin->new($db, $user_table); $db is an open connection to the database where the user data is stored. $user_table is the name of the table that holds the users' data. If we do not yet have the needed DB structure to store the user information, we can use this class method as a constructor as well: $ua = User::Simple::Admin->create_rdbms_db_structure($db, $user_table, [$extra_sql]); $ua = User::Simple::Admin->create_plain_db_structure($db, $user_table, [$extra_sql]); The first one should be used if your DBI handle ($db) points to a real RDBMS, such as PostgreSQL or MySQL. In case you are using a file- based DBD (such as DBD::XBase, DBD::DBM, DBD::CVS or any other which does not use a real RDBMS for storage), use "User::Simple::Admin->create_plain_db_structure" instead. What is the difference? In the first case, we will create a table that has internal consistency checks - Some fields are declared NOT NULL, some fields are declared UNIQUE, and the user ID is used as a PRIMARY KEY. This cannot, of course, be achieved using file-based structures, so the integrity can only be maintained from within our scripts. This module does not provide the functionality to modify the created tables by adding columns to it, although methods do exist to access and modify the values stored in those columns (see the "CREATING, QUERYING AND MODIFYING USERS" section below), as many DBDs do not implement the ALTER TABLE SQL commands. It does, however, allow you to specify extra fields in the tables at creation time - If you specify a third extra parameter, it will be included as part of the table creation - i.e., you can create a User::Simple table with fields for the user's first and family names and a UNIQUE constraint over them this way: $ua = User::Simple::Admin->create_rdbms_db_structure($db, $user_table, 'firstname varchar(30) NOT NULL, famname varchar(30) NOT NULL, UNIQUE (firstname,famname)'); Keep in mind that the internal fields are "id", "login", "passwd", "session" and "session_exp". Don't mess with them ;-) Avoid adding any fields starting with "set_" or called as any method defined here, as they will become unreachable. And, of course, keep in mind what SQL construct does your DBD support. If you add any fields with names starting with "adm_", they will be visible but not modifiable from within User::Simple - You will only be able to modify them from User::Simple::Admin. QUERYING FOR DATABASE READINESS In order to check if the database is ready to be used by this module with the specified table name, use the "has_db_structure" class method: $ok = User::Simple::Admin->has_db_structure($db, $user_table); RETRIEVING THE SET OF USERS %users = $ua->dump_users; Will return a hash with the data regarding the registered users with all of the existing DB fields, in the following form: ( $id1 => { login=>$login1, firstname=>$firstname1, famname=>$famname1 }, $id2 => { login=>$login2, firstname=>$firstname2, famname=>$famname2 }, (...) ) Of course, with the appropriate attributes. The internal attributes "id", "session" and "session_exp" will not be included in the resulting hashes (you have the "id" as the hash keys). CREATING, QUERYING AND MODIFYING USERS $id = $ua->new_user(login => $login, passwd => $passwd, [otherattribute => $otherattribute]); Creates a new user with the specified data. Returns the new user's ID. Only the login is mandatory (as it uniquely identifies the user), unless you have specified extra NOT NULL fields or constraints in the DB. If no password is supplied, the account will be created, but no login will be allowed until one is supplied. $ok = $ua->remove_user($id); Removes the user specified by the ID. $id = $ua->id($login); $login = $ua->login($id); $otherattrib = $user->otherattrib($id); Get the value of each of the mentioned attributes. Note that in order to get the ID you can supply the login, every other method answers only to the ID. In case you have the login and want to get the firstname, you can use "$ua-"firstname($ua->id($login));> Of course, beware: if you request for a field which does not exist in your table, User::Simple will raise an error and die just as if an unknown method had been called. $ok = $usr->set_login($id, $login); $ok = $usr->set_passwd($id, $passwd); Modifies the requested attribute of the specified user, setting it to the new value. Except for the login, they can all be set to null values - If the password is set to a null or empty value, the account will be locked (that is, no password will be accepted). The internal attributes "id", "session" and "session_exp" cannot be directly modified (you have the "id" as the hash keys). Just as with the accessors, if you have extra columns, you can modify them the same way: $ok = $usr->set_otherattrib($id, $value); i.e. $ok = $usr->set_name($id, $name); SESSIONS $ok = $usr->clear_session($id); Removes the session which the current user had open, if any. Note that you cannot create a new session through this module - The only way of creating a session is through the "ck_login" method of User::Simple. DEPENDS ON
Digest::MD5 SEE ALSO
User::Simple for the regular user authentication routines (that is, to use the functionality this module adimisters) AUTHOR
Gunnar Wolf <gwolf@gwolf.org> COPYRIGHT
Copyright 2005-2009 Gunnar Wolf / Instituto de Investigaciones Economicas UNAM This module is Free Software; it can be redistributed under the same terms as Perl. perl v5.10.0 2009-01-20 User::Simple::Admin(3pm)
All times are GMT -4. The time now is 12:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy