This commit is contained in:
2022-06-13 23:37:17 +08:00
parent d21608a860
commit 0230cb42a2
153 changed files with 62907 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
<?php
namespace auth;
class appmaster
{
/**
* 注册应用
* @param $appid
* @param $apppwd
* @param $url
* @param $type
* @param $scope
* @param $userid
* @param $name
* @param $home
* @param $present
* @return array|false|mixed|string
*/
public function reg($appid,$apppwd,$url,$type=null,$scope=null,$userid,$name,$home,$present){
global $authsql;
return $authsql->insert('oauth_clients',[
'client_id'=>$appid,
'client_secret'=>$apppwd,
'redirect_uri'=>$url,
'grant_types'=>$type,
'scope'=>$scope,
'user_id'=>$userid,
'name'=>$name,
'home'=>$home,
'present'=>$present,
]);
}
/**
* 删除应用
* @param $id
* @return false|int
*/
public function del($id){
global $authsql;
return $authsql->delete('oauth_clients',[
'id'=>$id
]);
}
public function edit($appid,$name,$home,$domain,$present){
global $authsql;
return $authsql->update('oauth_clients',[
'name'=>$name,
'home'=>$home,
"redirect_uri"=>$domain,
"present"=>$present
],[
"client_id"=>$appid
]
);
}
}