File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ class Rest extends WebService
9292 public const DELETE_CAMPUS = 'delete_campus ' ;
9393
9494 public const GET_USERS = 'get_users ' ;
95+ public const GET_USER_INFO_FROM_USERNAME = 'get_user_info_from_username ' ;
9596 public const USERNAME_EXIST = 'username_exist ' ;
9697 public const SAVE_USER = 'save_user ' ;
9798 public const SAVE_USER_GET_APIKEY = 'save_user_get_apikey ' ;
Original file line number Diff line number Diff line change 548548 $ data = $ restApi ->getUsersCampus ($ _POST );
549549 $ restResponse ->setData ($ data );
550550 break ;
551+ case Rest::GET_USER_INFO_FROM_USERNAME :
552+ if (empty ($ _POST ['loginname ' ])) {
553+ throw new Exception (get_lang ('NoData ' ));
554+ }
555+ $ item = api_get_user_info_from_username ($ _POST ['loginname ' ]);
556+ $ userInfo = [
557+ 'id ' => $ item ['user_id ' ],
558+ 'firstname ' => $ item ['firstname ' ],
559+ 'lastname ' => $ item ['lastname ' ],
560+ 'email ' => $ item ['email ' ],
561+ 'username ' => $ item ['username ' ],
562+ 'active ' => $ item ['active ' ],
563+ ];
564+ Event::addEvent (
565+ LOG_WS .$ action ,
566+ 'username ' ,
567+ Database::escape_string ($ _POST ['loginname ' ])
568+ );
569+ $ restResponse ->setData ($ userInfo );
570+ break ;
551571 case Rest::USERNAME_EXIST :
552572 Event::addEvent (LOG_WS .$ action , 'username ' , $ _POST ['loginname ' ]);
553573 $ data = $ restApi ->usernameExist ($ _POST ['loginname ' ]);
You can’t perform that action at this time.
0 commit comments