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->_className .= '/UserSNS';
|
||||||
$this->_model = new UserSNSModel();
|
$this->_model = new UserSNSModel();
|
||||||
$this->_defines = [
|
$this->_defines = [
|
||||||
'insert' => [
|
|
||||||
'fields' => ['site', 'user_uid', 'name', 'email', 'status'],
|
|
||||||
'fieldFilters' => ['status'],
|
|
||||||
'fieldRules' => []
|
|
||||||
],
|
|
||||||
'index' => [
|
'index' => [
|
||||||
'fields' => ['site', 'user_uid', 'name', 'email', 'status', 'created_at'],
|
'fields' => ['site', 'user_uid', 'name', 'email', 'status', 'created_at'],
|
||||||
'fieldFilters' => ['user_uid', 'status'],
|
'fieldFilters' => ['user_uid', 'status'],
|
||||||
@ -67,38 +62,34 @@ class UserSNSController extends \App\Controllers\Admin\AdminController
|
|||||||
//Insert관련
|
//Insert관련
|
||||||
protected function insert_process()
|
protected function insert_process()
|
||||||
{
|
{
|
||||||
//암호값 hash작업
|
// return parent::insert_process();
|
||||||
$this->_viewDatas['fieldDatas']['passwd'] = password_hash($this->_viewDatas['fieldDatas']['passwd'], PASSWORD_DEFAULT);
|
|
||||||
return parent::insert_process();
|
|
||||||
}
|
}
|
||||||
//Update관련
|
//Update관련
|
||||||
protected function update_process($entity)
|
protected function update_process($entity)
|
||||||
{
|
{
|
||||||
//암호값 hash작업
|
// return parent::update_process($entity);
|
||||||
$entity->passwd = password_hash($entity->passwd, PASSWORD_DEFAULT);
|
|
||||||
return parent::update_process($entity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////Action 모음
|
////Action 모음
|
||||||
//Insert관련
|
//Insert관련
|
||||||
final public function insert()
|
final public function insert()
|
||||||
{
|
{
|
||||||
return $this->insert_procedure();
|
// return $this->insert_procedure();
|
||||||
}
|
}
|
||||||
//Update관련
|
//Update관련
|
||||||
final public function update($uid)
|
final public function update($uid)
|
||||||
{
|
{
|
||||||
return $this->update_procedure($uid);
|
// return $this->update_procedure($uid);
|
||||||
}
|
}
|
||||||
//Toggle관련
|
//Toggle관련
|
||||||
final public function toggle($uid, string $field)
|
final public function toggle($uid, string $field)
|
||||||
{
|
{
|
||||||
return $this->toggle_procedure($uid, $field);
|
// return $this->toggle_procedure($uid, $field);
|
||||||
}
|
}
|
||||||
//Batchjob 관련
|
//Batchjob 관련
|
||||||
final public function batchjob()
|
final public function batchjob()
|
||||||
{
|
{
|
||||||
return $this->batchjob_procedure();
|
// return $this->batchjob_procedure();
|
||||||
}
|
}
|
||||||
//Delete 관련
|
//Delete 관련
|
||||||
final public function delete($uid)
|
final public function delete($uid)
|
||||||
|
|||||||
@ -12,15 +12,15 @@ CREATE TABLE tw_user (
|
|||||||
updated_at timestamp NULL DEFAULT NULL,
|
updated_at timestamp NULL DEFAULT NULL,
|
||||||
created_at timestamp NOT NULL DEFAULT current_timestamp(),
|
created_at timestamp NOT NULL DEFAULT current_timestamp(),
|
||||||
PRIMARY KEY (uid),
|
PRIMARY KEY (uid),
|
||||||
UNIQUE KEY id (id),
|
UNIQUE KEY (id),
|
||||||
UNIQUE KEY email (email)
|
UNIQUE KEY (email)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='사용자 정보';
|
) 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;
|
-- 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;
|
DROP TABLE IF EXISTS tw_user_profile;
|
||||||
|
|
||||||
CREATE TABLE tw_user_profile (
|
CREATE TABLE tw_user_profile (
|
||||||
uid int(10) unsigned NOT NULL AUTO_INCREMENT,
|
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 등등',
|
type varchar(10) NOT NULL COMMENT 'ICON|ADDRESS|PHONE|MOBILE|EMAIL 등등',
|
||||||
content varchar(255) NULL,
|
content varchar(255) NULL,
|
||||||
priority int(3) NOT NULL DEFAULT 1 COMMENT '표시 우선순서',
|
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
|
CONSTRAINT FOREIGN KEY (user_uid) REFERENCES tw_user (uid) ON DELETE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='사용자 추가정보';
|
) 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 (
|
CREATE TABLE tw_user_sns (
|
||||||
uid varchar(36) NOT NULL,
|
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값',
|
id varchar(255) NOT NULL COMMENT 'sns 로그인 인중후 Return ID값',
|
||||||
email varchar(50) NOT NULL,
|
|
||||||
name varchar(50) NOT NULL,
|
name varchar(50) NOT NULL,
|
||||||
|
email varchar(50) NOT NULL,
|
||||||
detail text NOT NULL COMMENT 'JSON형식 원본값',
|
detail text NOT NULL COMMENT 'JSON형식 원본값',
|
||||||
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용,unuse: 사용않함',
|
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용,unuse: 사용않함',
|
||||||
updated_at timestamp NULL DEFAULT NULL,
|
updated_at timestamp NULL DEFAULT NULL,
|
||||||
created_at timestamp NOT NULL DEFAULT current_timestamp(),
|
created_at timestamp NOT NULL DEFAULT current_timestamp(),
|
||||||
PRIMARY KEY (uid)
|
PRIMARY KEY (uid),
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='GOOGLE 로그인 후 정보';
|
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;
|
DROP TABLE IF EXISTS tw_logger;
|
||||||
|
|
||||||
@ -78,5 +82,5 @@ CREATE TABLE
|
|||||||
updated_at timestamp NULL DEFAULT NULL,
|
updated_at timestamp NULL DEFAULT NULL,
|
||||||
created_at timestamp NOT NULL DEFAULT current_timestamp(),
|
created_at timestamp NOT NULL DEFAULT current_timestamp(),
|
||||||
PRIMARY KEY (uid),
|
PRIMARY KEY (uid),
|
||||||
UNIQUE KEY hpilokey (ip,port)
|
UNIQUE KEY (ip,port)
|
||||||
) ENGINE = MyISAM DEFAULT CHARSET = utf8 COLLATE = utf8_general_ci COMMENT = 'hpilo 정보';
|
) ENGINE = MyISAM DEFAULT CHARSET = utf8 COLLATE = utf8_general_ci COMMENT = 'hpilo 정보';
|
||||||
@ -6,7 +6,7 @@ use App\Entities\HPILOEntity;
|
|||||||
|
|
||||||
class HPILOModel extends CommonModel
|
class HPILOModel extends CommonModel
|
||||||
{
|
{
|
||||||
protected $table = 'hpilo';
|
protected $table = 'tw_hpilo';
|
||||||
// protected $primaryKey = 'uid';
|
// protected $primaryKey = 'uid';
|
||||||
// protected $useAutoIncrement = true;
|
// protected $useAutoIncrement = true;
|
||||||
protected $allowedFields = ['customer', 'ip', 'port', 'id', 'passwd', 'model', 'processor', 'memory', 'health', 'power', 'detail', 'status', 'created_at'];
|
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 $table = 'tw_user_sns';
|
||||||
// protected $primaryKey = 'uid';
|
// protected $primaryKey = 'uid';
|
||||||
protected $useAutoIncrement = false;
|
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 = [
|
protected $validationRules = [
|
||||||
'uid' => 'required|string',
|
'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',
|
'site' => 'required|string',
|
||||||
|
'id' => 'required|string',
|
||||||
'name' => 'required|string',
|
'name' => 'required|string',
|
||||||
'email' => 'required|valid_email',
|
'email' => 'required|valid_email',
|
||||||
|
'detail' => 'required|string',
|
||||||
'status' => 'if_exist|string',
|
'status' => 'if_exist|string',
|
||||||
'updated_at' => 'if_exist|valid_date',
|
'updated_at' => 'if_exist|valid_date',
|
||||||
'created_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
|
public function create(array $datas): UserSNSEntity
|
||||||
{
|
{
|
||||||
$entity = new UserSNSEntity();
|
$entity = new UserSNSEntity();
|
||||||
$entity->uid = $datas['id'];
|
|
||||||
$entity->site = $this->getSiteName();
|
$entity->site = $this->getSiteName();
|
||||||
|
$entity->id = $datas['id'];
|
||||||
$entity->name = $datas['name'];
|
$entity->name = $datas['name'];
|
||||||
$entity->email = $datas['email'];
|
$entity->email = $datas['email'];
|
||||||
$entity->status = "standby";
|
$entity->detail = json_encode($datas);
|
||||||
return $this->create_process($entity);
|
return $this->create_process($entity);
|
||||||
}
|
}
|
||||||
public function modify(UserSNSEntity $entity, array $datas): UserSNSEntity
|
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>
|
<h2><a href=" /admin"><i class="fa fa-home"></i>Main</a></h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="accordion-item">
|
<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>
|
||||||
<div class="accordion-item">
|
<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>
|
||||||
<div class="accordion-item">
|
<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>
|
||||||
<div class="accordion-item">
|
<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">
|
<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>
|
<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>
|
</h2>
|
||||||
@ -35,7 +38,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<h2 class="accordion-header" id="panelsStayOpen-headingTwo">
|
<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>
|
<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>
|
</h2>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user