How to update email ids of users automatically
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2014 02:57 AM
I am creating user using Windows Active directory. The user is able to login without any problem. However he needs to update the email buy himself. Is there any way to automatically update the users email id from a text file or xls file based on his user name?
Labels:
- Labels:
-
Archive
7 REPLIES 7
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2014 07:21 AM
You can write a schedular that runs periodically (calling your java code) to update the users email id from text, csv or xls file.
http://wiki.alfresco.com/wiki/Scheduled_Actions
http://wiki.alfresco.com/wiki/Scheduled_Actions
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2014 01:44 AM
I have zero knowledge on java script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2014 05:52 AM
I was able to do for individual user using this script
But how to do for all users ??
var gens = search.luceneSearch("TYPE:\"{http://www.alfresco.org/model/content/1.0}person\"");var index;for(index=0;index<gens.length;++index){ if(gens[index].properties["cm:userName"]=="nazeers") { gens[index].properties["email"]="sameer@gmail.com"; gens[index].save(); }}
But how to do for all users ??
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2014 06:24 AM
Hi,
Upload file contains usernames and email id with some name for example: usesMailIds.csv
file contains username and mailId with comma separate in each line, example:
user1,user1@abc.com
user2,user2@abc.com
user3,user3@abc.com
Then in Javascript search for that file, then read content line by line and update the usermail as you are doing for single user.
Upload file contains usernames and email id with some name for example: usesMailIds.csv
file contains username and mailId with comma separate in each line, example:
user1,user1@abc.com
user2,user2@abc.com
user3,user3@abc.com
Then in Javascript search for that file, then read content line by line and update the usermail as you are doing for single user.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2014 07:10 AM
var a = new XMLHttpRequest(); I am getting error that XMLHttpRequest is not defined. How to read the file in javascrupt
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2014 08:44 AM
var doc = search.luceneSearch('@cm\\:name:"usersMails.csv"')[0]; var docText = doc.content; var lines = docText.split("\n"); for(var i=0; i<lines.length; i++){ var userMailId = lines[i].split(","); var userName = userMailId[0]; var mailId = userMailId[1]; var user = people.getPerson(userName); user.properties["email"]=mailId; user.save(); }
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2014 09:56 AM
Thanks that did the work
