This already worked for users without the 'admin' right but failed on
remote connections if the server had remote_userman set to 'no' (which
is the default). The result was pretty ugly, the user management
window opened but would repeatedly cause protocol error popups.
The implementation depends on the server change in
b60ceb3caecce2c86c484e6173fb1428b71d456a.
It will still go wrong if remote_userman is changed during the
server's lifetime, presumably a fairly rare event.
gtk_widget_set_sensitive(w, sensitive);
}
gtk_widget_set_sensitive(w, sensitive);
}
+static void menu_check_userman(void attribute((unused)) *v,
+ const char *err,
+ const char attribute((unused)) *value) {
+ if(err && !strncmp(err, "510", 3))
+ users_set_sensitive(FALSE);
+ else
+ users_set_sensitive(TRUE);
+}
+
/** @brief Called when our rights change */
static void menu_rights_changed(const char attribute((unused)) *event,
void attribute((unused)) *eventdata,
void attribute((unused)) *callbackdata) {
/** @brief Called when our rights change */
static void menu_rights_changed(const char attribute((unused)) *event,
void attribute((unused)) *eventdata,
void attribute((unused)) *callbackdata) {
- users_set_sensitive(!!(last_rights & RIGHT_ADMIN));
+ if(last_rights & RIGHT_ADMIN)
+ disorder_eclient_userinfo(client, menu_check_userman, "", "email", 0);
+ else
+ users_set_sensitive(FALSE);
}
/** @brief Create the menu bar widget */
}
/** @brief Create the menu bar widget */