123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619 |
- <?php
- $status = array
- (
- 1 => '普通',
- 2 => '封禁',
- );
- $cur = Dever::load('manage/auth.data', false);
- $desc = '';
- if($cur['role'] > 1)
- {
- $desc = $cur['username'] . ',你好,你可以在此管理你的下属账号';
- $child = array_keys(Dever::db('manage/role')->all());
- $admin = Dever::db('manage/admin_role')->list(array
- (
- 'col' => 'admin_id|admin_id',
- 'option' => array
- (
- 'role_id' => array('yes', 'in'),
- ),
- 'option_role_id' => implode(',', $child),
- ));
-
- Dever::$global['model']['manage/admin-list'] = array
- (
- 'option' => array
- (
- 'id' => array('yes', 'in'),
- ),
- 'option_id' => $admin ? array_keys($admin) : -1,
- );
- }
- $role = function()
- {
- return Dever::load('manage/role-all');
- };
- $group = function()
- {
- return Dever::load('manage/group-all');
- };
- $config = function()
- {
- return Dever::load('manage/config-all');
- };
- $top = function()
- {
- $data = Dever::load('manage/top.all');
- $data['state'] = 1;
- return $data;
- };
- return array
- (
-
- 'name' => 'admin',
-
- 'lang' => '管理账户设置',
- 'desc' => $desc,
-
-
-
-
- 'order' => 9,
-
- 'check' => 'email',
-
- 'sync' => array
- (
- 'manage/admin_role' => array
- (
-
- 'where' => array('admin_id' => 'id'),
-
- 'update' => array('role_id' => 'role'),
-
- 'type' => 'delete',
- )
- ),
-
-
-
- 'end' => array
- (
- 'update' => 'manage/auth.update',
- ),
-
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => '管理员ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- 'list' => true,
- ),
-
- 'username' => array
- (
- 'type' => 'varchar-24',
- 'name' => '管理员名',
- 'default' => '',
- 'desc' => '请输入管理员名',
- 'match' => 'is_string',
- 'update' => 'text',
-
-
-
- 'search' => 'order,fulltext',
- 'list' => true,
-
-
- ),
-
-
-
- 'email' => array
- (
- 'type' => 'varchar-150',
- 'name' => '邮箱-可用于登录,请准确填写,不允许重复',
- 'default' => '',
- 'desc' => '请输入邮箱',
- 'match' => Dever::rule('email'),
- 'update' => 'text',
-
- 'search' => 'fulltext',
- 'list' => true,
-
- 'level' => 1,
-
-
-
-
- ),
-
-
- 'mobile' => array
- (
- 'type' => 'varchar-32',
- 'name' => '手机号',
- 'default' => '',
- 'desc' => '请输入手机号',
- 'match' => Dever::rule('mobile'),
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- 'level' => 1,
-
-
- ),
-
- 'password' => array
- (
- 'type' => 'varchar-64',
- 'name' => '管理员密码',
- 'default' => '',
- 'desc' => '请输入管理员密码',
- 'match' => 'option',
- 'update' => 'password',
- 'callback' => 'hash.sha256',
- ),
-
- 'config' => array
- (
- 'type' => 'int-11',
- 'name' => '后台配置',
- 'default' => '1',
- 'desc' => '请选择后台配置',
- 'match' => 'is_numeric',
- 'option' => $config,
- 'update' => 'select',
- 'list' => true,
- ),
-
- 'role' => array
- (
- 'type' => 'varchar-100',
- 'name' => '角色',
- 'default' => '1',
- 'desc' => '请选择角色',
- 'match' => 'is_string',
- 'option' => $role,
- 'update' => 'checkbox',
-
- ),
- 'group' => array
- (
- 'type' => 'int-11',
- 'name' => '分组',
- 'default' => '1',
- 'desc' => '请选择分组',
- 'match' => 'is_numeric',
- 'option' => $group,
- 'update' => 'select',
-
- ),
- 'top' => array
- (
- 'type' => 'text-255',
- 'name' => '头部菜单-这里的头部菜单如果设置,则会覆盖角色中的头部菜单',
- 'default' => '',
- 'desc' => '请选择头部菜单',
- 'match' => 'option',
- 'update' => 'checkbox',
- 'option' => $top,
- ),
-
- 'state' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '数据状态',
- 'default' => '1',
- 'desc' => '请选择状态',
- 'match' => 'is_numeric',
-
-
-
-
- ),
-
- 'status' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '状态',
- 'default' => '1',
- 'desc' => '请选择状态',
- 'match' => 'is_numeric',
- 'option' => $status,
- 'update' => 'radio',
- 'list' => true,
- 'edit' => true,
- ),
-
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '录入时间',
- 'match' => array('is_numeric', DEVER_TIME),
- 'desc' => '',
-
- 'insert' => true,
- 'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
- 'manage' => array
- (
- 'delete' => false,
-
- 'res' => array
- (
- 'js' => 'demo',
- 'css' => 'demo',
- ),
-
-
-
- ),
-
-
- 'alter' => array
- (
- 2 => array
- (
-
-
- ),
- 'version' => 2,
- ),
-
-
-
-
-
- 'index' => array
- (
-
-
- ),
-
-
- 'request' => array
- (
-
- 'user' => array
- (
-
- 'where' => array
- (
-
-
- 'email' => 'yes',
- 'status' => 1,
- 'state' => 1,
-
- ),
- 'type' => 'one',
-
- 'cache' => true,
- ),
-
- 'email' => array
- (
-
- 'where' => array
- (
-
-
- 'email' => 'yes',
- 'status' => 1,
- 'state' => 1,
-
- ),
- 'type' => 'one',
-
- 'cache' => true,
- ),
-
- 'mobile' => array
- (
-
- 'where' => array
- (
-
-
- 'mobile' => 'yes',
- 'status' => 1,
- 'state' => 1,
-
- ),
- 'type' => 'one',
-
- 'cache' => true,
- ),
-
-
- 'password' => array
- (
- 'type' => 'update',
- 'where' => array
- (
- 'id' => 'yes',
- ),
- 'set' => array
- (
- 'password' => 'yes',
- ),
- ),
- ),
- );
|