Show "Microsoft Active Directory" information table in WordPress - wordpress

I have a spreadsheet in Microsoft Active Directory
Now I want to display the information in this table in WordPress
I came across this plugin according to the searches I did
But this plugin also does not have the ability to display information registered in Active Directory
What method or plugin do you think I should use to display Active Directory registered information in WordPress?

You have to call the Graph API to display user informatiom. This document is a good starting point.For example:
public function loadViewData()
{
$viewData = [];
// Check for flash errors
if (session('error')) {
$viewData['error'] = session('error');
$viewData['errorDetail'] = session('errorDetail');
}
// Check for logged on user
if (session('userName'))
{
$viewData['userName'] = session('userName');
$viewData['userEmail'] = session('userEmail');
$viewData['userTimeZone'] = session('userTimeZone');
}
return $viewData;
}
Please let me know if you have any questions.
Best,
James

Related

Inconsistent results when listing groups an external account belongs to

Our Google domain has groups (synced copies of our Active Directory email listservs/distribution groups) that have a lot of external accounts (currently kept as contacts in Active Directory).
As part of an intranet site I'm building I'm trying to be able to do mass search and replace of individual contact email address when for example a school district changes its domain name. One of the visual/verification steps I'm working on is to list the Google group membership of any selected external account, but I'm getting mixed results. For some accounts it seems to list the groups properly, and for others it doesn't seem to pull any. I have verified the external account's group membership in both Active Directory and in Google Admin group management, but when I query Google via code I don't get valid results every time... What am I missing? Code below.
-- in Global.asax
public static List<string> GOOGLE_GetListOfUsersGroups(string useremail)
{
List<string> groupList = new List<string>();
try
{
///stripped out credential/service stuff...
var groups = service.Groups.List();
groups.UserKey = useremail;
Groups gs = groups.Execute();
if (gs != null)
{
foreach (Google.Apis.Admin.Directory.directory_v1.Data.Group g in gs.GroupsValue)
groupList.Add(g.Email);
}
}
catch (Exception ex)
{
SendERROREmail("GLOBAL<HR>GOOGLE_GetListOfUsersGroups()<HR>useremail:" + useremail + "<HR>" + ex.ToString());
}
return groupList;
}
and the consuming function:
--- in Page.aspx
protected void ddlADExternalContacts_SelectedIndexChanged(object sender, EventArgs e)
{
lbContactsGoogleGroups.Items.Clear();
if (ddlADExternalContacts.SelectedIndex > 0)
{
//show what google has for same group
List<string> memberList = Global.GOOGLE_GetListOfUsersGroups(ddlADExternalContacts.SelectedValue);
if (memberList != null)
{
foreach (string s in memberList)
lbContactsGoogleGroups.Items.Add(new ListItem(s, s));
}
}
}
Also, does anyone have a good example how to handle this in Google's 'preferred' JSON format rather then the API route?
UPDATE: Ok, its not my code, its something with the group/Google. When I use the 'try it' functionality on the sdk admin site I get the same results for groups that work (in my code and their site) and no results from the same groups that should be showing results...
{
"kind": "admin#directory#groups",
"etag": "\"HKdfSgTnCxrWl3RtRnlZSCPY3NjdWJxz53nrhwSz7ob4/oMWMqbsluP5m2PCo8Y7WmWeHGP4\""
}
Not that that helps me any, as there's no error or anything, just the 'no groups' result as if it can't find the external account...
UPDATE2: Ok, based on what I'm seeing after some testing, I have a sneaky suspicion that Google is doing some validation of emails before checking for group membership and reporting anything. I.E. if the email being searched for is no longer valid (client's server doesn't responds that the account is reachable/enabled/exists...), it won't bother going any further... will try it out with a few more email addresses that I know should be invalid and update....later.
It looks like what you are experiencing might be a bug.
This has been reported on Google Issue Tracker here.
What you can do in this situation is to star the issue above and eventually add a comment saying that you are affected by it.

How to open specific page in application from URL Shared link Xamarin forms

I need to do two things : First , I want to share Model to social media For example I have product which has title , text, id(or specific url)
I use share.plugin to share this model , Second , I want when user click the link if app is installed it navigate to specific page
else it navigate to web site page I followed links which talks about deep linking and app indexing but i didn't find something like i want
Note : I Used prism for xamarin forms
Update : I Tried this
private void RegisterLink()
{
//var url = $"https://unelectronics.com/ar/product/{GenerateSEOTitle(ProductData.ID, ProductData.SKUName)}".Trim();
var url = "https://unelectronics.com/ar/product/888-lg-55c7v-55-4k-oled-smart-tv";
var entry = new AppLinkEntry
{
Title = ProductData.Title,
AppLinkUri = new Uri(url, UriKind.RelativeOrAbsolute),
IsLinkActive = true,
};
entry.KeyValues.Add("contentType", "product");
entry.KeyValues.Add("companyName", "UNElectronics");
entry.KeyValues.Add("appName", "UNElectronics");
Application.Current.AppLinks.RegisterLink(entry);
}
which is applink concept but it doesn't work for me
Any help ?

Panels added via Panelizer are deleted after going to node/edit and saving the node

I create an article and then "Customize this page" and add a panel to the page. I can re-save that page using panelizer over and over again with no issues. However, when I go into the "new draft" page and edit and publish the node, all items that were added with panelizer are removed from the article.
Very similar to this https://drupal.org/node/1572202 with the difference being that I notice it happens when I save from the node/edit page. I already have the patch on that page applied because it was added to the latest version of panelizer which I have.
There are known issues with panelizer, if you are using the Workbench module. Basically, the association between the revision and the panelized node gets lost.
There is a detailed explanation here: http://www.phase2technology.com/blog/panelizer-and-workbench-moderation-can-get-along/
It will probably need some adaptation for each config, but this should get you started:
function MYMODULE_node_update($node) {
if (!empty($node->old_vid)) {
// fetch the did from the old revision
$old_did = db_query("SELECT did FROM {panelizer_entity} WHERE entity_id = :nid AND revision_id = :oldvid ORDER BY revision_id DESC",
array(":nid" => $node->nid, ":oldvid" => $node->old_vid))
->fetchField();
if (!empty($old_did) && !empty($node->panelizer['page_manager']) && empty($node->panelizer['page_manager']->did)) {
$node->panelizer['page_manager']->did = $old_did;
}
}
}

find last editor aka author of Item in Sitecore

Ok I've used this in the past to get last editor and it works great when running on sites that use workflow but it doesnt return any users for sites that do not use workflow..
var contentWorkflow = contentItem.Database.WorkflowProvider.GetWorkflow(contentItem);
var contentHistory = contentWorkflow.GetHistory(contentItem);
if (contentHistory.Length > 0)
{
//submitting user (string)
string lastUser = contentHistory[contentHistory.Length - 1].User;
}
Can you reply with a way to get last editor of an item regardless of whether they use workflow or not?
Thanks
Try to use
contentItem.Statistics.UpdatedBy
You can check more members of the ItemStatistics class here.

How can I modify the Book Copy module in Drupal 6 to forward the user to a different starting tab once a copy is made?

Example call to copy a book using the Book Copy module in Drupal 6 (assuming a node exists with book id of 142):
www.examplesite.com/book_copy/copy/142
When the above site is called and node 142 is copied it then notifies the user that the book was copied, but starts the user out on the Outline tab for the book copy. I think it would be more intuitive to start the user out on the Edit tab for the book copy so the user can immediately start to edit the information for the book. The outline is less important than setting up the actual initial details for the book which are in the Edit tab.
Does anyone know how I could modify the module to forward the user to the Edit tab? I looked through the code and it's just not clicking. I'm having problems interpreting exactly how this Book Module is working under the hood. Any suggestions will be greatly appreciated. Thanks!
I have no experience with the book_copy module, but looking at the last lines of the book_copy_copy_book() function:
$book = node_load(array('nid' => $newbid));
$book->bookcopydata = array();
$book->bookcopydata['message'] = t('Successfully cloned "%message", now viewing copy.', array('%message' => $message));
if (_book_outline_access($book)) {
$book->bookcopydata['url'] = 'node/'. $newbid .'/outline';
}
else {
$book->bookcopydata['url'] = 'node/'. $newbid;
}
// The function signature is: hook_book_copy_goto_alter(&$data);
drupal_alter("book_copy_goto", $book);
drupal_set_message($book->bookcopydata['message']);
drupal_goto($book->bookcopydata['url']); // requires user has 'administer book outline' or can access personal books
the user would automatically end on the new book page if he did not have the 'administer book outlines' right. If you want the user to always end on the new book edit page, you could just replace the whole if
if (_book_outline_access($book)) { ... }
clause with the assignment from its else part with an adjusted url:
$book->bookcopydata['url'] = 'node/'. $newbid . '/edit';
However, changing a modules code directly is not recommended (update clashes), especially if the module provides a hook to achieve the change you need 'from outside'. So the 'right' way in your situation would be to implement the offered hook_book_copy_goto_alter(&$data) in a custom module in order to adjust the redirection URL to your liking:
function yourModule_book_copy_goto_alter(&$new_book) {
$new_book->bookcopydata['url'] = 'node/'. $new_book->nid . '/edit';
}

Resources