servermgrv2 init...
This commit is contained in:
parent
e493e59c85
commit
e494edd250
@ -18,11 +18,6 @@ class UserSNSController extends \App\Controllers\Admin\AdminController
|
||||
$this->_className .= '/UserSNS';
|
||||
$this->_model = new UserSNSModel();
|
||||
$this->_defines = [
|
||||
'insert' => [
|
||||
'fields' => ['site', 'user_uid', 'name', 'email', 'status'],
|
||||
'fieldFilters' => ['status'],
|
||||
'fieldRules' => []
|
||||
],
|
||||
'index' => [
|
||||
'fields' => ['site', 'user_uid', 'name', 'email', 'status', 'created_at'],
|
||||
'fieldFilters' => ['user_uid', 'status'],
|
||||
@ -67,38 +62,34 @@ class UserSNSController extends \App\Controllers\Admin\AdminController
|
||||
//Insert관련
|
||||
protected function insert_process()
|
||||
{
|
||||
//암호값 hash작업
|
||||
$this->_viewDatas['fieldDatas']['passwd'] = password_hash($this->_viewDatas['fieldDatas']['passwd'], PASSWORD_DEFAULT);
|
||||
return parent::insert_process();
|
||||
// return parent::insert_process();
|
||||
}
|
||||
//Update관련
|
||||
protected function update_process($entity)
|
||||
{
|
||||
//암호값 hash작업
|
||||
$entity->passwd = password_hash($entity->passwd, PASSWORD_DEFAULT);
|
||||
return parent::update_process($entity);
|
||||
// return parent::update_process($entity);
|
||||
}
|
||||
|
||||
////Action 모음
|
||||
//Insert관련
|
||||
final public function insert()
|
||||
{
|
||||
return $this->insert_procedure();
|
||||
// return $this->insert_procedure();
|
||||
}
|
||||
//Update관련
|
||||
final public function update($uid)
|
||||
{
|
||||
return $this->update_procedure($uid);
|
||||
// return $this->update_procedure($uid);
|
||||
}
|
||||
//Toggle관련
|
||||
final public function toggle($uid, string $field)
|
||||
{
|
||||
return $this->toggle_procedure($uid, $field);
|
||||
// return $this->toggle_procedure($uid, $field);
|
||||
}
|
||||
//Batchjob 관련
|
||||
final public function batchjob()
|
||||
{
|
||||
return $this->batchjob_procedure();
|
||||
// return $this->batchjob_procedure();
|
||||
}
|
||||
//Delete 관련
|
||||
final public function delete($uid)
|
||||
|
||||
@ -12,15 +12,15 @@ CREATE TABLE tw_user (
|
||||
updated_at timestamp NULL DEFAULT NULL,
|
||||
created_at timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
PRIMARY KEY (uid),
|
||||
UNIQUE KEY id (id),
|
||||
UNIQUE KEY email (email)
|
||||
UNIQUE KEY (id),
|
||||
UNIQUE KEY (email)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='사용자 정보';
|
||||
-- insert into tw_user (uid,id,passwd,name,email,role,status) select uuid(),id,passwd,name,email,role,status from cfmgr.user;
|
||||
DROP TABLE IF EXISTS tw_user_profile;
|
||||
|
||||
CREATE TABLE tw_user_profile (
|
||||
uid int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
user_uid varchar(36) NULL COMMENT '사용자 추가정보',
|
||||
user_uid varchar(36) NULL COMMENT '사용자 정보',
|
||||
type varchar(10) NOT NULL COMMENT 'ICON|ADDRESS|PHONE|MOBILE|EMAIL 등등',
|
||||
content varchar(255) NULL,
|
||||
priority int(3) NOT NULL DEFAULT 1 COMMENT '표시 우선순서',
|
||||
@ -31,19 +31,23 @@ CREATE TABLE tw_user_profile (
|
||||
CONSTRAINT FOREIGN KEY (user_uid) REFERENCES tw_user (uid) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='사용자 추가정보';
|
||||
|
||||
DROP TABLE IF EXISTS tw_user_auth_google;
|
||||
DROP TABLE IF EXISTS tw_user_sns;
|
||||
|
||||
CREATE TABLE tw_user_auth_google (
|
||||
uid varchar(36) NOT NULL,
|
||||
CREATE TABLE tw_user_sns (
|
||||
uid int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
user_uid varchar(36) NULL COMMENT '사용자 정보',
|
||||
site varchar(20) NOT NULL COMMENT 'Site: GOOGLE,FACEBOOK 등등',
|
||||
id varchar(255) NOT NULL COMMENT 'sns 로그인 인중후 Return ID값',
|
||||
email varchar(50) NOT NULL,
|
||||
name varchar(50) NOT NULL,
|
||||
email varchar(50) NOT NULL,
|
||||
detail text NOT NULL COMMENT 'JSON형식 원본값',
|
||||
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용,unuse: 사용않함',
|
||||
updated_at timestamp NULL DEFAULT NULL,
|
||||
created_at timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
PRIMARY KEY (uid)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='GOOGLE 로그인 후 정보';
|
||||
PRIMARY KEY (uid),
|
||||
UNIQUE KEY (site,id),
|
||||
CONSTRAINT FOREIGN KEY (user_uid) REFERENCES tw_user (uid) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='SNS 로그인 후 정보';
|
||||
|
||||
DROP TABLE IF EXISTS tw_logger;
|
||||
|
||||
@ -78,5 +82,5 @@ CREATE TABLE
|
||||
updated_at timestamp NULL DEFAULT NULL,
|
||||
created_at timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
PRIMARY KEY (uid),
|
||||
UNIQUE KEY hpilokey (ip,port)
|
||||
UNIQUE KEY (ip,port)
|
||||
) ENGINE = MyISAM DEFAULT CHARSET = utf8 COLLATE = utf8_general_ci COMMENT = 'hpilo 정보';
|
||||
@ -6,7 +6,7 @@ use App\Entities\HPILOEntity;
|
||||
|
||||
class HPILOModel extends CommonModel
|
||||
{
|
||||
protected $table = 'hpilo';
|
||||
protected $table = 'tw_hpilo';
|
||||
// protected $primaryKey = 'uid';
|
||||
// protected $useAutoIncrement = true;
|
||||
protected $allowedFields = ['customer', 'ip', 'port', 'id', 'passwd', 'model', 'processor', 'memory', 'health', 'power', 'detail', 'status', 'created_at'];
|
||||
|
||||
@ -9,13 +9,15 @@ class UserSNSModel extends CommonModel
|
||||
protected $table = 'tw_user_sns';
|
||||
// protected $primaryKey = 'uid';
|
||||
protected $useAutoIncrement = false;
|
||||
protected $allowedFields = ['uid', 'user_uid', 'site', 'name', 'email', 'status', 'updated_at', 'created_at'];
|
||||
protected $allowedFields = ['uid', 'user_uid', 'site', 'id', 'name', 'email', 'detail', 'status', 'updated_at', 'created_at'];
|
||||
protected $validationRules = [
|
||||
'uid' => 'required|string',
|
||||
'user_uid' => 'required|required',
|
||||
'user_uid' => 'if_exist|regex_match[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/]',
|
||||
'site' => 'required|string',
|
||||
'id' => 'required|string',
|
||||
'name' => 'required|string',
|
||||
'email' => 'required|valid_email',
|
||||
'detail' => 'required|string',
|
||||
'status' => 'if_exist|string',
|
||||
'updated_at' => 'if_exist|valid_date',
|
||||
'created_at' => 'if_exist|valid_date',
|
||||
@ -32,11 +34,11 @@ class UserSNSModel extends CommonModel
|
||||
public function create(array $datas): UserSNSEntity
|
||||
{
|
||||
$entity = new UserSNSEntity();
|
||||
$entity->uid = $datas['id'];
|
||||
$entity->site = $this->getSiteName();
|
||||
$entity->id = $datas['id'];
|
||||
$entity->name = $datas['name'];
|
||||
$entity->email = $datas['email'];
|
||||
$entity->status = "standby";
|
||||
$entity->detail = json_encode($datas);
|
||||
return $this->create_process($entity);
|
||||
}
|
||||
public function modify(UserSNSEntity $entity, array $datas): UserSNSEntity
|
||||
|
||||
@ -8,15 +8,18 @@
|
||||
<h2><a href=" /admin"><i class="fa fa-home"></i>Main</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/user"><i class="fa fa-users"></i>계정관리</a></h2>
|
||||
<h2><a href="/admin/user"><i class="fa fa-users"></i>계정 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/auth/google"><i class="fa fa-users"></i>GOOGLE계정관리</a></h2>
|
||||
<h2><a href="/admin/usersns"><i class="fa fa-users"></i>SNS 계정 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/logger"><i class="fa fa-recycle"></i>Log관리</a></h2>
|
||||
<h2><a href="/admin/hpilo"><i class="fa fa-recycle"></i>HP Server 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/logger"><i class="fa fa-recycle"></i>Log 관리</a></h2>
|
||||
</div>
|
||||
<!-- <div class="accordion-item">
|
||||
<h2 class="accordion-header" id="panelsStayOpen-headingOne">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseOne" aria-expanded="false" aria-controls="panelsStayOpen-collapseOne"><b>상점관리</b></button>
|
||||
</h2>
|
||||
@ -35,7 +38,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="accordion-item">
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="panelsStayOpen-headingTwo">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseTwo" aria-expanded="false" aria-controls="panelsStayOpen-collapseTwo"><b>Magic Transit</b></button>
|
||||
</h2>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user