HTML-EP-Explorer

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

MANIFEST			This file
MANIFEST.SKIP
Makefile.PL			Makefile generator
README				I mean it! :-)
html/action.ep
html/admin/index.ep
html/admin/prefs.ep
html/folder.gif
html/index.ep
html/listwin.ep
html/logfile.ep
html/noframes.ep
html/queue.ep
html/topwin.ep
html/prefs.ep
html/unknown.gif
lib/HTML/EP/Explorer.pm
lib/HTML/EP/Explorer/Install.pm
t/base.t

README  view on Meta::CPAN


    You should now see a directory listing. If so, proceed to the
    CONFIGURATION manpage.

CONFIGURATION
    Besides the questions you already answered when installing the
    explorer, the system is configurable via any Web browser.
    Assuming the Explorer is reachable below
    http://localhost/explorer/, Point your browser to

      http://localhost/explorer/admin/prefs.ep

  Security considerations

    The first thing you probably notice is that you need not supply
    a password for accessing this page. This should be changed. A
    typical configuration requests that only the user root can visit
    this page. For example, with Apache, you could insert the
    following into your httpd.conf:

      <Location /explorer/admin>

README  view on Meta::CPAN

MODIFYING THE EXPLORER
    When modifying the explorer, you should know about the following
    methods:

  Initializing the Explorer

    Probably any HTML page using the explorer system should contain
    the following:

      <ep-package name=HTML::EP::Explorer accept="de,en">
      <ep-explorer-init noprefs=0>

    The *_ep_explorer_init* method is initializing the users cookie.
    First it verifies, whether the user already has an explorer
    cookie set. If not, the user will be redirected to the
    *prefs.ep* page, unless the attribute *noprefs* is set. This
    page will allow him to fix his personal settings and return to
    the calling page.

    The explorer class is a subclass of both *HTML::EP::Locale* and
    *HTML::EP::Session*. That means that the locale settings are
    still valid in the *ep-package* call (in particular the *accept*
    attribute that tells this page is ready for either german, aka
    de, or english). Likewise the attributes of *ep-session* are
    valid in the *ep-explorer-init* call. the HTML::EP(3) manpage.
    the HTML::EP::Session(3) manpage.

  Reading and/or writing the admin settings

    Within admin/prefs.ep and some other pages, you find the
    following call:

      <ep-explorer-config file="config.pm" maysafe=0>

    which read the admin settings from an external file, by default
    config.pm. The settings will instead be read from the CGI input
    and saved into the same file, if the CGI variable *save* and the
    attribute *maysafe* are true. (The latter should happen within
    the amdin dirctory only.)

README  view on Meta::CPAN

            're' => '\.ps$'
          }

    $num_directories$
        The number of elements in $self->{'directories'}. May be 0.

  Reading and/or writing the users settings

    The users settings can be read and/or written by calling

      <ep-explorer-prefs>

    This will call *_ep_explorer_init* internally, by setting the
    *noprefs* attribute to true. If either of the CGI variables
    *save* or *save_and_return* is set, it will read the users new
    settings from the CGI environment by running $self->ReadPrefs
    and store the session (that is, return a cookie) by calling *ep-
    session-store*.

    If the current oage is called from another page (that is, the
    CGI variable *return_to* is set to the calling page) and the CGI
    variable *save_and_return* is set, then the calling page is
    included with *ep-include*.

html/admin/index.ep  view on Meta::CPAN

<p>
  <ep-language language="de">
    Diese Seite ist das Administrationsmenü des HTML::EP-Explorers.
  <ep-language language="en">
    This page is the administration menu of the HTML::EP Explorer.
  </ep-language>
</p>
<ol>
  <li>
    <ep-language de="Die" en="You may adjust the">
    <a href="prefs.ep?language=$_ep_language$">
      <ep-language de="Systemeinstellungen" en="System preferences">
    </a>
    <ep-language de="können Sie hier verändern."
                 en=".">
  </li>
  <li>
    <ep-language de="Auch Ihre"
                 en="Your">
    <a href="../prefs.ep?language=$_ep_language$">
      <ep-language de="persönlichen Einstellungen" en="private settings">
    </a>.
    <ep-language de="können Sie ändern."
                 en="may be modified as well.">
  </li>
  <li>
    <ep-language de="Die Ansicht Ihrer Benutzer finden Sie"
                 en="Your users view is">
    <a href="../index.ep?language=$_ep_language$">
      <ep-language de="hier" en="here">

html/admin/prefs.ep  view on Meta::CPAN

    Auf dieser Seite können Sie die Systemeinstellungen des
    <a href="http://www.ispsoft.de/products/ep/explorer/">EP-Explorer</a>
    festlegen.
  <ep-language language="en">
    This page allows you to customize the system settings of the
    <a href="http://www.ispsoft.de/products/ep/explorer/">EP-Explorer</a>.
  </ep-language>
</p>
<div align=center>
<p>
  <form action="prefs.ep" method=POST>
  <table>
    <tr><th><ep-language de="E-Mail-Adresse des Administrators:" en="Admins e-mail address:">
        </th>
        <td><input name="explorer_config_email"
		   value="$config->email$" size=50>
        </td>
    </tr>
    <tr><th><ep-language de="Aktionen:" en="Actions:"></th>
        <td>
	  <table>

html/listwin.ep  view on Meta::CPAN

      <th>Unix-Permissions</th>
      <th><a href="JavaScript:SortBy('uid')">User</a></th>
      <th><a href="JavaScript:SortBy('gid')"><ep-language de="Gruppe" en="Group"></a></th>
      <th><a href="JavaScript:SortBy('size')"><ep-language de="Größe" en="Size"></a></th>
      <th><a href="JavaScript:SortBy('mtime')"><ep-language de="Datum" en="Date"></a></th>
  </tr>
<ep-explorer-browse basedir="$env->DOCUMENT_ROOT$" item=l>
</table>
</form>
<div align=center>
  <a href="prefs.ep?return_to=listwin.ep">
    <ep-language de="Voreinstellungen" en="Preferences"></a>
</div>
</body></html>

html/noframes.ep  view on Meta::CPAN

<h1>HTML::EP Explorer</h1>
<table>
  <tr><th>Name</th><th>Unix-Permissions</th><th>User</th>
      <th><ep-language de="Gruppe" en="Group"></th>
      <th><ep-language de="Größe" en="Size"></th>
      <th><ep-language de="Datum" en="Date"></th>
  </tr>
<ep-explorer-browse basedir="$env->DOCUMENT_ROOT$" item=l>
</table>
<div align=center>
  <a href="prefs.ep?return_to=index.ep">
    <ep-language de="Voreinstellungen" en="Preferences"></a>
</div>
</body></html>

html/prefs.ep  view on Meta::CPAN

<ep-package name=HTML::EP::Explorer accept-language="de,en">
<ep-explorer-prefs>
<ep-if cnd="'$_ep_language$' eq 'de'">
  <ep-set var="Title" val="EP-Explorer: Voreinstellungen">
  <ep-set var="Ok" val="Einstellungen speichern">
  <ep-set var="ReturnButton" val="Speichern und zurück zur Ausgangsseite">
<ep-else>
  <ep-set var="Title" val="EP-Explorer: Preferences">
  <ep-set var="Ok" val="Save these settings">
  <ep-set var="ReturnButton" val="Save and return to the calling page">
</ep-if>
<html><head><title>$Title$</title></head>

html/prefs.ep  view on Meta::CPAN

    Sie aber auch später immer wieder hierher zurückkehren.
  <ep-language language="en">
    This page allows you to customize the
    <a href="http://www.ispsoft.de/products/ep/explorer/">EP-Explorer</a>.
    You are guided to this page automatically when using the system for
    the first time. Of course you are able to return at any later time.
  </ep-language>
</p>
<div align=center>
<p>
  <form action="prefs.ep" method=GET>
  <table>
    <tr><th><ep-language de="Ihre E-Mail-Adresse:" en="Your e-mail address:">
        </th>
        <td><input name="explorer_prefs_email" value="$session->prefs->email$">
        </td>
    </tr>
  </table>
  <input type=submit name="save" value="$Ok$">
  <ep-if eval="$cgi->return_to$">
    <input type=hidden name="return_to" value="$cgi->return_to$">
    <input type=submit name="save_and_return" value="$ReturnButton$">
  </ep-if>
  </form>
</p>

lib/HTML/EP/Explorer.pm  view on Meta::CPAN

    $attr->{'class'} ||= "HTML::EP::Session::Cookie";
    $attr->{'id'} ||= "explorer-session";
    $attr->{'path'} ||= "/";
    $attr->{'expires'} ||= "+10y";
    eval { $self->_ep_session($attr) };
    my $session = $self->{$attr->{'var'} || 'session'};
    if ($self->{debug}) {
	require Data::Dumper;
	$self->print("Session = ", Data::Dumper::Dumper($session), "\n");
    }
    if (!$attr->{'noprefs'} and
	($@  or  !exists($session->{'prefs'}))) {
	# First time run, open the prefs page.
	my $prefs = $attr->{'prefs_page'} || "prefs.ep";
	my $return_to = $attr->{'return_to'} || $self->{'env'}->{'PATH_INFO'};
	$self->print("_ep_explorer_init: Redirecting to $prefs, returning to $return_to\n")
	    if $self->{'debug'};
	$cgi->param('return_to', $return_to);
	$self->{'_ep_output'} .= $self->_ep_include({file => $prefs});
	$self->_ep_exit({});
    }
    '';
}

sub InitialConfig {
    my $self = shift;
    { 'actions' => [],
      'filetypes' => [
        { 'name' => $self->{'_ep_language'} eq 'de' ?

lib/HTML/EP/Explorer.pm  view on Meta::CPAN

    }
    $self->{'actions'} = $self->{'config'}->{'actions'};
    $self->{'status_actions'} = $self->{'config'}->{'status_actions'};
    $self->{'directories'} = $self->{'config'}->{'directories'};
    $self->{'filetypes'} = $self->{'config'}->{'filetypes'};
    $self->{'num_directories'} = @{$self->{'directories'}};
    '';
}

sub ReadPrefs {
    my $self = shift; my $prefs = shift;
    my $cgi = $self->{'cgi'};
    foreach my $var ($cgi->param()) {
	next unless $var =~ /^explorer_prefs_(.*)/;
	my $vr = $1;
	my $val = $cgi->param($var);
	$prefs->{$vr} = $val;
    }
    $prefs;
}

sub _ep_explorer_prefs {
    my $self = shift;  my $attr = shift;
    my $debug = $self->{'debug'};
    $attr->{'noprefs'} = 1;
    $self->_ep_explorer_init($attr);
    my $session = $self->{$attr->{'var'} ||= 'session'};
    my $cgi = $self->{'cgi'};
    my $return;
    if (($return = $cgi->param('save_and_return'))  ||
	 $cgi->param('save')) {
	$self->print("_ep_explorer_prefs: Saving.\n") if $debug;
	$session->{'prefs'} = $self->ReadPrefs($session->{'prefs'});
	if ($debug) {
	    require Data::Dumper;
	    $self->print("_ep_explorer_save: Got\n",
			 Data::Dumper->new([$session->{'prefs'}])
			     ->Indent(1)->Terse(1)->Dump(), "\n");
	}
	$attr->{'locked'} = 1;
	$self->_ep_session_store($attr);
    }
    if ($return  and  (my $return_to = $cgi->param('return_to'))) {
	$self->print("Returning to $return_to\n") if $debug;
	$self->{'_ep_output'} .=
	    $self->_ep_include({'file' => $return_to});
	$self->print("Done including $return_to\n") if $debug;

lib/HTML/EP/Explorer.pm  view on Meta::CPAN

You should now see a directory listing. If so, proceed to
L<CONFIGURATION>.


=head1 CONFIGURATION

Besides the questions you already answered when installing the explorer,
the system is configurable via any Web browser. Assuming the Explorer
is reachable below http://localhost/explorer/, Point your browser to

  http://localhost/explorer/admin/prefs.ep


=head2 Security considerations

The first thing you probably notice is that you need not supply a password
for accessing this page. This should be changed. A typical configuration
requests that only the user root can visit this page. For example, with
Apache, you could insert the following into your httpd.conf:

  <Location /explorer/admin>

lib/HTML/EP/Explorer.pm  view on Meta::CPAN

When modifying the explorer, you should know about the following
methods:


=head2 Initializing the Explorer

Probably any HTML page using the explorer system should contain
the following:

  <ep-package name=HTML::EP::Explorer accept="de,en">
  <ep-explorer-init noprefs=0>

The I<_ep_explorer_init> method is initializing the users cookie.
First it verifies, whether the user already has an explorer cookie
set. If not, the user will be redirected to the I<prefs.ep> page,
unless the attribute I<noprefs> is set. This page will allow him
to fix his personal settings and return to the calling page.

The explorer class is a subclass of both I<HTML::EP::Locale> and
I<HTML::EP::Session>. That means that the locale settings are
still valid in the I<ep-package> call (in particular the I<accept>
attribute that tells this page is ready for either german, aka de,
or english). Likewise the attributes of I<ep-session> are valid
in the I<ep-explorer-init> call. L<HTML::EP(3)>.
L<HTML::EP::Session(3)>.


=head2 Reading and/or writing the admin settings

Within F<admin/prefs.ep> and some other pages, you find the following
call:

  <ep-explorer-config file="config.pm" maysafe=0>

which read the admin settings from an external file, by default
F<config.pm>. The settings will instead be read from the CGI
input and saved into the same file, if the CGI variable I<save>
and the attribute I<maysafe> are true. (The latter should happen
within the F<amdin> dirctory only.)

lib/HTML/EP/Explorer.pm  view on Meta::CPAN


The number of elements in B<$self-E<gt>{'directories'}>. May be 0.

=back


=head2 Reading and/or writing the users settings

The users settings can be read and/or written by calling

  <ep-explorer-prefs>

This will call I<_ep_explorer_init> internally, by setting the
I<noprefs> attribute to true. If either of the CGI variables
I<save> or I<save_and_return> is set, it will read the users
new settings from the CGI environment by running
B<$self-E<gt>ReadPrefs> and store the session (that is, return
a cookie) by calling I<ep-session-store>.

If the current oage is called from another page (that is, the
CGI variable I<return_to> is set to the calling page) and the
CGI variable I<save_and_return> is set, then the calling page
is included with I<ep-include>.



( run in 0.641 second using v1.01-cache-2.11-cpan-98e64b0badf )