## Online sharepoint: how to obtain the user profile properties of the user who modified the item in the display form?

We can use the REST API of user profile with jQuery to achieve it. The following code for your reference, add the code in a scripting editor web element on the visualization form page.

``````

\$(function () {

var accountName=GetAccountName(displayName);
var requestUri = _spPageContextInfo.webAbsoluteUrl +
"/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='"+accountName+"'";

//execute AJAX request
\$.ajax({
url: requestUri,
type: "GET",
async: false,
success: function (data) {
var userProperties=data.d.UserProfileProperties.results;
var htmlTable='<table width="100%" border="0" cellspacing="0" cellpadding="2">';
\$.each(userProperties,function(i,property){
htmlTable+="<tr><td>"+property.Key+"</td><td>"+property.Value+"</td></tr>";
});
htmlTable+="</table>";
\$("table.ms-formtoolbar").after(htmlTable);
},
error: function () {
}
});
});

function GetAccountName(displayName){
var accountName="";
var requestUri = _spPageContextInfo.webAbsoluteUrl +

//execute AJAX request
\$.ajax({
url: requestUri,
type: "GET",
async: false,
success: function (data) {
if(data.d.results.length>0){
}

},
error: function () {
}
});
return accountName;
}

``````

## Obtain other user information using PnPJS with SPFx

I want to get a list of items from a SharePoint list and display them specifically in SPFx webpart. I could use PnPJS to get the Text and Number fields, but for the Author field, I only get the ID.

I would like to obtain other information, such as the email address, the name to display and the user's image. My code now looks like this:

``````        sp.web.lists.getByTitle (& # 39; Projects & # 39;). items.get (). then (items => {
//console.log(items)
})
``````

However I am receiving something like this:

## Obtain the user details of the Person or Group field using the REST API

REST 2010 or 2013? On-prem or Office 365 / SharePoint Online?

This works for me in SharePoint Online:

``````https: //yourServer/sites/site/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor (accountName = @ v, propertyName = & # 39; WorkPhone & # 39;)? @ v = & # 39; i: 0% 23.f | membership | samc @ yourDomain com & # 39;
``````

## How to correctly design a database if I want to store user updates

I'm trying to build a back-end API for a very classic application that deals with human users.

I am currently thinking about how I will monitor the changes in this database, to be able to apply some analysis if necessary.

My first idea is simply to record the update events in my database and then calculate the current state of the object.
But I feel that it lacks a "cache" or something like that. Obviously I do not want a user to deny my service simply by uploading their profile to a client.

Then, the second idea, the cache: a central database that is basically the database that you would have if you did not want to record the events.
But how safe can I be that this state database will always be synchronized with the db event after numerous updates? Should I periodically run a script to verify this status db?

Are there best practices for this problem?
Thank you

## UI design – How to make the text of the user interface longer?

I am working on a menu that needs a neat description, but I have noticed that it only shows 4 letters, then it is cut and this does not seem correct.

I click with the right button, I select UI> text and, again, it only shows 4 words, although I can write much more there. Am I doing something wrong here?

I'm not sure how to overcome this and I want to ask if anyone knows how to overcome this. It seems such an odd limit to put on the canvas of the user interface.

You have kept a separate column in the table as `login_type` for each user and store 1 for superadmin, 2 for admin, 3 for others … etc,

``````                \$ sql = "SELECT user_id, username, password of type_login FROM logon WHERE username =?";
``````

Edit above two lines and this `if (\$ type_login == 1) {` check below

``````                                                    if (mysqli_stmt_fetch (\$ stmt)) {
session_start ();
\$ _SESION["loggedin"] = true;
\$ _SESION["user_id"] = \$ user_id;
if (\$ type_login == 1) {
} elseif (\$ type_login == 2) {
} elseif (\$ type_login == 3) {
}
} else {
}
}
``````

``````                                                                                                                if (\$ username == & # 39; SuperAdmin & # 39;) {
} elseif (\$ username == & # 39; Admin & # 39;) {
} elseif (\$ username == & # 39; Other & # 39;) {
}
``````

## For the cover-up, what is the difference between the two examples offered by Google: changes based on the user agent and text instead of flash to bots?

I do not see the point in the question since the cover-up is quite simple, what users see, is what search engines should see. Analyzing what a Google employee has written does not change anything and, therefore, technically, you can waste your time doing it.

But, for the sake of this, I will point out the differences in the two examples:

The conclusion is that these examples are written by a human being, they are not perfect, but if you have to ask, then you are probably doing something that is bordering on what you know is something that you should not be doing.

## javascript – Simple user management system Node.js

I am working on an application that is completely made of javascript (in addition to the database) and I created a simple user management system for the application.

This user management system creates a query to the database that contains the user's information (the database contains the user's information, not the query) based on a few arguments from the command line, decrypts the data in the database and then print the result in the console.

I've been programming for 2 years, but I'm self-taught and I was looking for comments / criticisms about my code.

Note: Some of the modules in the main script are not included, but for the most part their functions should be intuitive.

Here is my code:

Main script:

``````// this is an instance of a `DataBase` class:
const users = require (& # 39; ../../ Code / MiddleWare / Database-comms / createUser & # 39;). users
const lookup = require (& # 39; ./ lookup & # 39;)
const decryptAll = require (& # 39; ./ decrypt & # 39;)

asynchronous function null () {
yes (proceso.argv[2] === & # 39; -e & # 39;) {
console.dir (decryptAll (pending search) (& # 39; Email & # 39 ;, process.argv[3], users, process.argv[4] === & # 39; -ex & # 39;)), {colors: true, depth: Infinity})
} else if (process.argv[2] ? process.argv[2].match (/ ^  d + \$ /): false) {
console.dir (decryptAll (wait for search) (& # 39; ID & # 39 ;, parseInt (process.argv[2]), users, process.argv[3] === & # 39; -ex & # 39 ;, false)), {colors: true, depth: Infinity})
} else {
console.dir (decryptAll (wait for search) (& # 39; Username & # 39 ;, process.argv[2] ? process.argv[2] : & # 39; & # 39 ;, users, proceso.argv[3] === & # 39; -ex & # 39;)), {colors: true, depth: Infinity})
}
} ()
``````

"search" module:

``````module.exports = asynchronous function (type, string, users, exact, encryption = true) {
const aes = require (& # 39; ../../ Code / MiddleWare / Security / index & # 39;). encryption.AES
const retval = []
wait for users.query (& # 39; Users & # 39;). then ((data) => {
for (let's go to data) {
yes (encrypted? (exact? aes.decrypt (i[type]) === string: aes.decrypt (i[type]) .match (string): i[type] === string) {
retval.push (i)
}
}
})

returns retval.length === 0? false: retval
}
``````

The "decrypt" module:

``````const decrypt = require (& # 39; ../../ Code / MiddleWare / Security / encryption & # 39;). AES.decrypt

module.exports = function (array) {
if (! array) {
false return
}

const retval = []

function decryptAll (obj) {
}

for (const i de array) {
const item = decryptAll (i)
item.Data = JSON.parse (item.Data)
retval.push (item)
}

retval return
}
$$`` `$$
``````

## php – Error in user registration with Laravel

I am studying the Laravel framework, I am using the framework registration method through make: auth. I have made some changes to send more data to the bank, but after making these changes I can not insert a record and it does not return any errors.

``````

@csrf

first name:

ACB:

e-mail

sex:

--select--
male-
female
other

Birthdate:

``````

This is the submission form.

I have already modified the Laravel RegisterController file with the additional information.

``````protected function validator (array \$ data)
{
return Validator :: make (\$ data, [
'name' => ['required', 'string', 'max:255'],
& # 39; email & # 39; => ['required', 'string', 'email', 'max:255', 'unique:users'],
& # 39; cpf & # 39; => ['required', 'string', 'confirmed','unique:users'],
& # 39; gender & # 39; => ['required', 'string', 'confirmed'],
& # 39; Bdate & # 39; => ['required', 'string', 'confirmed'],
& # 39; password & # 39; => ['required', 'string', 'min:8', 'confirmed'],
]);
}

/ **
* Create a new user instance after valid registration.
*
* @param array \$ data
* @return  App  User
* /
protected function create (array \$ data)
{
return User :: create ([
'name' => \$data['name'],
& # 39; email & # 39; => \$ date['email'],
& # 39; password & # 39; => Hash :: make (\$ data['password'])
& # 39; cpf & # 39; => \$ data['cpf'],
& # 39; gender & # 39; => \$ date['gender'],
& # 39; Bdate & # 39; => \$ date['Bdate'],
]);
}
``````

Before the changes, users were created normally. After clicking on the submit button I continue on the msm page the form data is cleaned but nothing happens and it does not return an error.