I am trying to update the Person property "emailFeedDisabled" using Alfresco Service API
call (Alfresco Version Alfresco Enterprise 4.0.2) , but It never allowed me to update the
property value.
I am using HttpWebRequest PUT method through a C# code, but the property always remains
unchanged.
Please find the below C# code:
AlfrescoAdmin.aspx.cs ———————-
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Net; using System.IO; using System.Text; using System.Xml;
public partial class AlfrescoAdmin : System.Web.UI.Page {
protected void btnPost_Click(object sender, EventArgs e) { txtResponse.Text = ""; if (String.IsNullOrEmpty(txtAdminUser.Text)) { lblError.Text = "Please enter a admin user name"; return; } else if (String.IsNullOrEmpty(txtPassword.Text)) { lblError.Text = "Please enter a admin password"; return; } lblError.Text = ""; string adminUser = txtAdminUser.Text; string adminPass = txtPassword.Text; string userName = txtUser.Text; string typeOfAPI = ddlAPI.SelectedValue;
I am experiencing the same issue on 4.2c Community edition. There are no error messages in the logs, I'm making the PUT request using curl, the other changes work fine except for the emailFeedDisabled:
Login to alfresco share. Open the user menu on the toolbar and click My Profile and go to Notifications page. Disable Email Notification Feed and click OK. This would disable email updates such as recent site activities and site invitations.
Thanks for replying. I'm trying to change the setting for another user. I am an admin, however the setting is not available in the Admin Console.
I haven't managed to find the setting in the database or the userStore, does anyone know where it is? As a last resort I will copy their password hash, change their password, log in as the user and then change the password back.
I later found a way to do this, You can actually access the notifications page from an admin accouint by manually generating the url, ie localhost:8080/share/page/user/{username}/user-notifications To do it programmatically, it would simply be a matter of generating the correct POST request.
[edit] Turns out that wasn't quite correct, but you can do it like this (have tested): curl –user '…' –header "Content-Type: application/json" –data '{"username": "user", "properties": {"cm:emailFeedDisabled": true}}' http://localhost:8080/alfresco/service/slingshot/profile/userprofile