This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies. | |
*/ | |
var express = require('express') | |
, http = require('http') | |
, path = require('path'); | |
var app = express(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VipbbsrsbbsController < ApplicationController | |
# GET /vipbbsrsbbs | |
# GET /vipbbsrsbbs.json | |
def index | |
@vipbbsrsbbs = Vipbbsrsbb.all | |
respond_to do |format| | |
format.html # index.html.erb | |
format.json { render json: @vipbbsrsbbs } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def destroy | |
@vipbbsrsbb = Vipbbsrsbb.find(params[:id]) | |
@vipbbsrsbb.destroy | |
respond_to do |format| | |
format.html { redirect_to vipbbsrsbbs_url } | |
#format.json { head :no_content } | |
format.js {} | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def attempt_login | |
if authorized_user = User.authenticate(params[:username], params[:hashed_password]) | |
# unless authorized_user.eql?(false) | |
session[:user_id] = authorized_user.id | |
session[:username] = authorized_user.username | |
case authorized_user.account_type | |
when "admin" | |
redirect_to :action => "index" | |
when "it" | |
redirect_to :action => "it" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def attempt_login | |
authorized_user = User.authenticate(params[:username], params[:hashed_password]) | |
unless authorized_user.eql?(false) | |
session[:user_id] = authorized_user.id | |
session[:username] = authorized_user.username | |
case authorized_user.account_type | |
when "admin" | |
redirect_to :action => "index" | |
when "it" | |
redirect_to :action => "it" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def attempt_login | |
authorized_user = User.authenticate(params[:username], params[:hashed_password]) | |
if authorized_user | |
redirect_to(:action => 'index') | |
else | |
redirect_to(:action => 'login') | |
end | |
end |