The final piece of the administration puzzle: authentication. There are many different approaches which is why I saved this step for last. This episode will cover a few techniques including the simple solution used for this site.
# controllers/application.rb
def admin?
session[:password] == 'foobar'
end
# sessions_controller.rb
def create
session[:password] = params[:password]
flash[:notice] = "Successfully logged in"
redirect_to home_path
end
def destroy
reset_session
flash[:notice] = "Successfully logged out"
redirect_to login_path
end
# config/routes.rb
map.resources :sessions, :episodes
map.home '', :controller => 'episodes', :action => 'index'
map.login 'login', :controller => 'sessions', :action => 'new'
map.logout 'logout', :controller => 'sessions', :action => 'destroy'
分享到:
相关推荐
1. 明文:`superpassword simple ****` 2. 加密:`super password cipher ****` 为了确保网络设备的安全,华为交换机还支持通过不同的访问方式对用户进行身份验证。对于三种常见的访问方式——console、telnet和web...
[HUAWEI]super password simple 123456 ``` ##### screen-length - **用途**:用于设置用户输入某一命令执行后终端屏幕每屏显示的行数。 - **示例**: ```shell <HUAWEI>screen-length 24 ``` ##### screen-...
这意味着需要先使用 `set authentication password {cipher | simple} password` 命令配置口令后,登录才能成功。 - 当选择 `scheme` 时,进行本地或远端用户名和口令认证。具体是本地认证还是远端认证,则取决于...
control it and fulfil files transferring at the same time , that is a simple combination for telnet and ftp server. Of course there are many fails and bugs in it , I'll appreciate the correction ...
set authentication password {cipher | simple} password ``` **视图**:用户界面视图 **参数**: - `{cipher | simple}`:指定密码的加密方式,`cipher` 表示加密存储,`simple` 表示明文存储。 - `password`:...
control it and fulfil files transferring at the same time , that is a simple combination for telnet and ftp server. Of course there are many fails and bugs in it , I'll appreciate the correction ...
[H3C-ui-aux0]set authentication password simple 123456 ``` 完成配置后,当用户尝试通过Console端口登录时,系统会提示输入口令。 ### 二、命令控制级别的设置 用户可以通过命令控制级别来限制不同的操作权限...
this server and client programs is created for the s3c2410 platform board to conveniencely control it and fulfil files transferring at the same time , that is a simple combinationfor telnet and ftp ...
- `set authentication-mode password simple <password>`:设置简单密码,如`set authentication-mode password simple 222`。 - `user privilege level 3`:设置用户权限等级。 #### 显示当前配置 - `display ...
- **示例**: `[S3026-ui-vty0-4] set authentication-mode password simple 222` ##### 23. 设置VTY用户权限级别 - **命令**: `user privilege level <level>` - **功能**: 设置VTY用户的权限级别。 - **示例**...
- **配置Super Password**:使用命令`[SwitchA]super password level 3 simple super3`设置超级密码,以便低级别用户可以通过输入此密码提升权限。 ##### 6. TELNET RADIUS验证配置 - **配置RADIUS服务器**:以华为...
[Router]super password level 3 simple super [Router]user-interface con 0 [Router-ui-console0]user privilege level 1 [Router-ui-console0]set authentication password simple abc ``` 对于需要使用用户名和...
[H3C-ui-console0]set authentication password simple h3c ``` 其中,`console 0`指的是通过Console线连接的端口。 #### 5. 用户的命令控制级别设置 通过命令控制级别设置,管理员可以限制不同用户的权限。例如,...
这个项目名为"YT-Django-Simple-Blog-App-Part8-User-Authentication-System",它涵盖了Web开发中的关键安全功能——用户登录、注册和权限管理。 首先,Django内置了强大的用户认证系统,允许开发者轻松地实现用户...
- 设置口令:`set authentication password simple h3c`。 - 设置命令控制级别:`user privilege level 0`。 - 设置超级用户密码:`super password level 1 simple 111111`等。 8. **配置TELNET密码验证** - ...
- **命令**:`super password <level> { simple | cipher } <password>` - **功能说明**:配置超级密码,用于限制访问级别较高的用户界面。 #### 十六、接口状态查询 - **命令**:`display interface` - **功能说明...
[S3026-ui-vty0-4]set authentication-mode password simple 222 ``` 设置VTY接口的登录密码为“222”。 - **设置用户权限等级** ``` [S3026-ui-vty0-4]user privilege level 3 ``` 设置用户权限等级为3级,...
3. **设置密码**:`[S3026-ui-vty0-4] set authentication-mode password simple 222` 4. **设置用户权限级别**:`[S3026-ui-vty0-4] user privilege level 3` #### 八、配置端口属性 在接口视图下,还可以配置端口...
- `set authentication-mode password simple 222`设置VTY接口的登录密码为222。 - `user privilege level 3`设置用户权限等级,数字越高,权限越大。本例中设置为3级。 ### 5. 配置RADIUS服务器 - `radiusscheme ...