/** * Update tenant password. * * <code> * php artisan tenancy::manage:update <tenant_name> <new_db_pass> * </code> * * @param array $args * @return bool */ public function update($args = array()) { // If we don't have any arguments then tell the user how to // properly format the command. if (count($args) !== 2) { echo 'Usage: php artisan tenancy::manage:update <tenant_name> <new_db_pass>'; return false; } list($name, $new_pass) = $args; try { Manager::update($name, $new_pass); echo "DONE! Tenant ({$name}) password has been updated."; } catch (Exception $e) { echo $e->getMessage(); } }
function update_psw_save() { $password = get_post_value('password'); $id = get_post_value('id'); $status = get_post_value('status'); $field = array('password' => md5($password)); $m = new Manager(); $m->clear(); $m->setTable('vcb_manage_user'); //设置表名 $m->setField($field); ///设置更新字段及值,(键值数组) $m->setWhere('id', '=', $id); //设置Where条件 $m->update(); //返回 echo '<br>操作成功,<a href="index" >返回</a><br>'; }
function update_psw_save() { $password = get_post_value('password'); $id = get_post_value('id'); $field = array('password' => md5($password)); $m = new Manager(); $m->clear(); $m->setTable('vcb_manage_user'); //设置表名 $m->setField($field); ///设置更新字段及值,(键值数组) $m->setWhere('id', '=', $id); //设置Where条件 $data = $m->update(); if ($data) { $this->assign('message', true); $this->setReturnType('message'); } }