Northeast Indiana ISSA Logo

We are a community of information security professionals cultivating the free exchange of ideas in the greater Fort Wayne area.

Become a Member

Social Gathering

Social GatheringThursday, September 20th | 5:30 PM | Mitchell's After a summer hiatus we are ready to get the band back together.  Please join us at Mitchell's Sports Bar & Grill. Grab a cool beverage and catch up with the group. We'll give a sneak peak of the meetings planned for the rest of th...

Event Details
class UsersController < ApplicationController
	before_filter :authenticate,
								:only => [:index, :edit, :update, :destroy,
													:followers, :following]
	before_filter :correct_user, :only => [:edit, :update]
	before_filter :admin_user,   :only => :destroy
	
	def index
		@users = User.paginate(:page => params[:page])
		@title = "All users"
	end
	
	def show
		@user = User.find(params[:id])
		@microposts = @user.microposts.paginate(:page => params[:page])
		@title = @user.name
	end

	def following
		@title = "Following"
		@user = User.find(params[:id])
		@users = @user.following.paginate(:page => params[:page])
		render 'show_follow'
	end
	
	def followers
		@title = "Followers"
		@user = User.find(params[:id])
		@users = @user.followers.paginate(:page => params[:page])
		render 'show_follow'
	end

	def new
		@user  = User.new
		@title = "Sign up"
	end
	
	def create
		@user = User.new(params[:user])
		if @user.save
			sign_in @user
			redirect_to @user, :flash => { :success => "Welcome to the Sample App!" }
		else
			@title = "Sign up"
			render 'new'
		end
	end
	
	def edit
		@title = "Edit user"
	end
	
	def update
		if @user.update_attributes(params[:user])
			redirect_to @user, :flash => { :success => "Profile updated." }
		else
			@title = "Edit user"
			render 'edit'
		end
	end

	def destroy
		@user.destroy
		redirect_to users_path, :flash => { :success => "User destroyed." }
	end

	private

		def correct_user
			@user = User.find(params[:id])
			redirect_to(root_path) unless current_user?(@user)
		end
		
		def admin_user
			@user = User.find(params[:id])
			redirect_to(root_path) if !current_user.admin? || current_user?(@user)
		end
end
blog

Welcome to Northeast Indiana ISSA’s New Website

Northeast Indiana ISSA is pleased to announce the launch of our new website. The goal of the new site is to simplify the information presented. Stuff like “when is the next meeting?” and “how can I be...

Continue Reading
indiana-lores

Join the ISSA Mailing List

Stay informed about the biggest threats facing the infosec industry locally and globally and be the first to know about upcoming ISSA events in the area.

Join the Mailing List