Sponsored Content
Full Discussion: Login page in html on unix
Top Forums Web Development Login page in html on unix Post 302336159 by pludi on Tuesday 21st of July 2009 10:52:59 AM
Old 07-21-2009
Argh, head, meet desk. Sorry for lashing out with my last question, shouldn't answer questions when sleepy.

As for your problem, the type of text/plain shouldn't affect execution in any way.

The shebang line (the one starting with #!) should look like one of the following:
  • for Bourne/POSIX-Shell compatible shells: #!/bin/sh
  • for Korn-Shell (ksh): #!/usr/bin/ksh
  • for Bo(u)rne-Again-Shell (bash): #!/bin/bash or #!/usr/bin/bash
 

9 More Discussions You Might Find Interesting

1. News, Links, Events and Announcements

Unix Manual (man-page) pages in HTML

LINK: Unix Manual (man page) pages in HTML http://www.rt.com/man/ : More then 100 Commands found on a Unix system mannual pages can be obtained/refered here. Good Link.. (1 Reply)
Discussion started by: killerserv
1 Replies

2. Shell Programming and Scripting

linking unix generated text file to html page

i am trying to link the text files that i generated from my shell script to an html page, to that i can view them using a browser, like internet explorer. i want to open the text files in html page when i enter a command to view the text file from the shell command. please could anyone help... (1 Reply)
Discussion started by: alexd
1 Replies

3. UNIX and Linux Applications

Html web page to Unix Connectivity

Hi All, I need a basic overview of connecting a HTML web page to Unix I will give a brief of my exact requirement. There will be a front end HTML page - a web page which will have certain buttons. Each button will have certain functionality. For eg: There is a button for Disk Usage. When the... (1 Reply)
Discussion started by: abhilashnair
1 Replies

4. Web Development

APACHE: Tie in Web Page login with server login

Hello, I have created a web page on a server using apache and added .htaccess and .htpasswd in the folder for authentification. I was wondering if there was anyway to tie-in the login for this page with the login used to logon to the server. i.e. the same login info. is used for both,... (2 Replies)
Discussion started by: WhotheWhat
2 Replies

5. Cybersecurity

APACHE: Tie in Web Page login with server login

Hello, I have created a web page on a server using apache and added .htaccess and .htpasswd in the folder for authentification. I was wondering if there was anyway to tie-in the login for this page with the login used to logon to the server. i.e. the same login info. is used for both, when... (1 Reply)
Discussion started by: WhotheWhat
1 Replies

6. Solaris

Accessing a HTML page

Hi All, In our unix server we have an apache web server running. I can access the default apache web page from my windows machine. Now, I want to create my own webpage. Therefore I created webpage at /export/home/myname/test.html file. Where do I need to place this file and what do I need... (0 Replies)
Discussion started by: pkm_oec
0 Replies

7. Shell Programming and Scripting

Execute unix command from an html page in windows

i have a problem situation, where i have a html file say click.html. i have a button "ls" in that html page. i run this html file in windows....Now say if i click that "ls" button it must connect to the unix server and execute ls and return the results back to html page in windows. can anyone tell... (8 Replies)
Discussion started by: niteesh_!7
8 Replies

8. AIX

How to Use a UNIX Shell Script to Create an HTML Web Page?

dear friends , in my work i have to monitor some system performance in hourly basis by runing some commands , for example (lpstat) to know that all the queue is ready how can i create webpage and connect it with the server (AIX operating system) and make this page refreshed every 10 second and... (12 Replies)
Discussion started by: rami abusweilei
12 Replies

9. Shell Programming and Scripting

How to generate HTML page from UNIX script out-put?

Hi All. This my first post to this forum, and i assuming it will be best out-of all. I am quite new to Unix scripting so please excuse me for any silly questions - I am trying to create on Unix script in which it telnet to my server, check the connectivity of the server and then it... (2 Replies)
Discussion started by: HHarsh
2 Replies
CatalystX::SimpleLogin::Manual(3pm)			User Contributed Perl Documentation		       CatalystX::SimpleLogin::Manual(3pm)

NAME
CatalystX::SimpleLogin::Manual - How to use and customise CatalystX::SimpleLogin. Tutorial We're using a sample application here, to make the instructions a little easier. This assumes that you have Catalyst, Catalyst::Devel, Template Toolkit, and the Catalyst authentication and session plugins installed. catalyst.pl MyApp cd MyApp script/myapp_create.pl view HTML TT Edit lib/MyApp.pm and add CatalystX::SimpleLogin, Authenticate, and the Session plugins to the use Catalyst plugin list: use Catalyst qw/-Debug ConfigLoader +CatalystX::SimpleLogin Authentication Session Session::Store::File Session::State::Cookie Static::Simple/; Add the following config for authentication, including two sample users: __PACKAGE__->config( 'Plugin::Authentication' => { default => { credential => { class => 'Password', password_field => 'password', password_type => 'clear' }, store => { class => 'Minimal', users => { bob => { password => "bobpw", }, william => { password => "billpw", }, }, }, }, }, ); Execute " script/myapp_server.pl " and, as part of the debug output, you should see: [debug] Loaded Chained actions: .-------------------------------------+--------------------------------------. | Path Spec | Private | +-------------------------------------+--------------------------------------+ | /login | /login/login | | /logout | /login/logout | '-------------------------------------+--------------------------------------' Go to " localhost:3000 " and you should see the Catalyst welcome screen. Go to " localhost:3000/login " and you should get a login screen containing username and password text fields, a 'Remember' checkbox, and a 'Login' button. Enter 'bob' and 'bobpw'. You should be logged in and taken to the welcome screen. If you execute " localhost:3000/logout " you will be logged out, and should see this in the debug output (the welcome screen will stay the same). Now go to " lib/MyApp/Controller/Root.pm " and remove the lines saying: use strict; use warnings; use parent 'Catalyst::Controller'; and add the following lines: use Moose; use namespace::autoclean; BEGIN { extends 'Catalyst::Controller' } Now add a new action to " lib/MyApp/Controller/Root.pm " and include " Does('NeedsLogin') " to use the Catalyst ActionRole that is part of SimpleLogin: sub hello_user : Local Does('NeedsLogin') { my ( $self, $c ) = @_; $c->res->body('<h2>Hello, user!</h2>'); } Restart the server and you can see the new action. Go to "htp://localhost:3000/hello_user" and you'll get the 'Hello, user!' page. Now execute "http://localhost:3000/logout" and try "http://localhost:3000/hello_user" again. You will be presented with a login screen. Authorization CatalystX::SimpleLogin also provides /login/required and /login/not_required for easy chaining off of for actions which should only be available to authenticated users. package MyApp::Controller::Secure; sub setup : Chained('/login/required') PathPart('') CaptureArgs(1) { my ( $self, $c, $id ) = @_; # setup actions for authenticated-user-only access $c->stash->{id} = $id; } sub something_secure : Chained('setup') PathPart Args(0) { my ( $self, $c ) = @_; # only authenticated users will have access to this action } sub open_to_all : Chained('/login/not_required') PathPart Args(0) { my ( $self, $c ) = @_; # this is available to everyone } For more fine-grained control, you can use ACL checks to refine access control policies. This functionality is provided via Catalyst::ActionRole::ACL. Please consult the ACL documentation for steps to setup your application. The ACL checks work by allowing you to add additional attributes on your actions which control the particular role(s) required or allowed. package MyApp; __PACKAGE__->config( 'Controller::Login' => { actions => { required => { Does => ['ACL'], AllowedRole => ['admin', 'poweruser'], # ANY of these # RequiresRole => ['extranet'], # ALL of these ACLDetachTo => 'login', }, }, }, ); package MyApp::Controller::Foo; BEGIN { extends 'Catalyst::Controller' } sub do_something : Chained('/login/required') : Does('ACL') RequiresRole('createinvoice') ACLDetachTo('/login') {} You can also add a message, which will be put into the flash key 'error_msg'. Add the following to the hello_user action: : LoginRedirectMessage('Please Login to view this Action') Now we'll create a Template Toolkit template that can be customized. Create a " root/login/login.tt " file with the following lines. [% error_msg %] [% render_login_form %] Now edit " lib/MyApp.pm " and add the config shown below to remove the 'RenderAsTTTemplate' trait, and add 'flash_to_stash' for Catalyst::Plugin::Session (to allow the error message to be passed to the next request): __PACKAGE__->config( 'Plugin::Session' => { flash_to_stash => 1 }, 'Controller::Login' => { traits => ['-RenderAsTTTemplate'], }, # Other config.. ); Restart the server and try to view the hello_user page without being logged in. You should be reredireced to the login page with the error message displayed at the top. You can replace " [% render_login_form %] " with your own html, and customize it as you please. <div class="error">[% error_msg %]</div> <form id="login_form" method="post" > <fieldset class="main_fieldset"> <div><label class="label" for="username">Username: </label><input type="text" name="username" id="username" value="" /> </div> <div><label class="label" for="password">Password: </label> <input type="password" name="password" id="password" value="" /> </div> <div><label class="label" for="remember">Remember: </label> <input type="checkbox" name="remember" id="remember" value="1" /> </div> <div><input type="submit" name="submit" id="submit" value="Login" /> </div> </fieldset></form> Or you can customize it using HTML::FormHandler HTML rendering features, and the 'login_form_args' config key. perl v5.14.2 2012-07-15 CatalystX::SimpleLogin::Manual(3pm)
All times are GMT -4. The time now is 06:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy