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
92
92
public const DELETE_CAMPUS = 'delete_campus ' ;
93
93
94
94
public const GET_USERS = 'get_users ' ;
95
+ public const GET_USER_INFO_FROM_USERNAME = 'get_user_info_from_username ' ;
95
96
public const USERNAME_EXIST = 'username_exist ' ;
96
97
public const SAVE_USER = 'save_user ' ;
97
98
public const SAVE_USER_GET_APIKEY = 'save_user_get_apikey ' ;
Original file line number Diff line number Diff line change 548
548
$ data = $ restApi ->getUsersCampus ($ _POST );
549
549
$ restResponse ->setData ($ data );
550
550
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 ;
551
571
case Rest::USERNAME_EXIST :
552
572
Event::addEvent (LOG_WS .$ action , 'username ' , $ _POST ['loginname ' ]);
553
573
$ data = $ restApi ->usernameExist ($ _POST ['loginname ' ]);
You can’t perform that action at this time.
0 commit comments