Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 26, 2012, 05:11:18 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Interested in joining the WebsiteBaker team?
For more Information read
here
or on our
new website
.
155544
Posts in
21714
Topics by
7736
Members
Latest Member:
chris85
WebsiteBaker Community Forum
English
Modules
(Moderator:
Argos
)
entry to the next admin page, sessions?
Pages: [
1
]
Go Down
Author
Topic: entry to the next admin page, sessions? (Read 849 times)
djdeeno
Offline
Posts: 51
entry to the next admin page, sessions?
«
on:
February 03, 2011, 10:54:18 PM »
i build a videochat module, it working correctly, but wnat build someting extra but don't know how to that.
With /module/videowebchat/view.php comes into a page.
But build also a admin.php into the /modules/videowebchat/ directory, the admin.php is need it where admins can kick some chatters in the videowebchat.
But what is the beste way to build this php so that only the admin (whos log in to the websitebaker/admin login page, can acces this php file only. I have build the admin.php and also a link to that from the websitebaker admin/module pages, but everybody can visit the website.com/modules/videowebchat/admin.php
I want that only the admin from websitebaker/admin can visit that page.
Thanks allot.
«
Last Edit: February 04, 2011, 04:26:24 PM by djdeeno
»
Logged
PurpleEdge
Offline
Posts: 232
Re: access admin.php only when admin is login
«
Reply #1 on:
February 04, 2011, 08:30:15 AM »
Have a look at this page...
http://www.websitebaker2.org/en/help/developer-guide/wb-module-files.php
...it describes some of the files that can be used in a module.
Then have a look at an existing module that works similar to your needs. Look especially at the modify.php file - this is for backend administration and it will almost certainly have the code you need to restrict access to an administrator.
Logged
djdeeno
Offline
Posts: 51
Re: access admin.php only when admin is login
«
Reply #2 on:
February 04, 2011, 11:27:51 AM »
Great
What i have done is making a own admin.php into the modules/videowebchat/ directory. This admin.php begins with :
require('../../config.php');
require_once(WB_PATH.'/framework/class.admin.php');
$admin = new admin('Pages', 'pages_modify');
require_once(WB_PATH.'/framework/functions.php');
if (!defined('WB_PATH')) die(header('Location: ../../index.php'));
And wel its working fine, i can acces dit page from de administration panel from websitebaker, but can't visit the page if i not log on, correct thats works fine.
But have other question, i want to show the administrator name on the admin.php page, normaly you can do that with:
$wb->get_display_name()
But that doenst work here, its works fine with the view.php page but doenst work in the admin.php that i have build Is there a require field, or php session that i have be missed?
thanks
Logged
Luisehahne
Board Member
Development Team
Offline
Posts: 3147
Re: access admin.php only when admin is login
«
Reply #3 on:
February 04, 2011, 12:13:22 PM »
$admin->get_display_name();
Try this
Dietmar
Logged
We are human beings - and nobody is perfect at all.
djdeeno
Offline
Posts: 51
Re: access admin.php only when admin is login
«
Reply #4 on:
February 04, 2011, 01:01:08 PM »
Thanks
Its working, great!!!
Mars
Logged
djdeeno
Offline
Posts: 51
Re: access admin.php only when admin is login
«
Reply #5 on:
February 04, 2011, 04:25:08 PM »
another question
On the modify.php page i can give the next:
<?php echo $fetch_page_content['max_length']; ?>
than i see my echo correctly, but when i go from the modify.php to the admin.php, wich i make by myself, i can see the echo anywmore.
if i try to make a session thats also doens't work.
Whats the beste way to make thhe echo entry to the next page, so the
<?php echo $fetch_page_content['max_length']; ?>
also see on the admin page.
Thanks again
Logged
djdeeno
Offline
Posts: 51
Re: entry to the next admin page, sessions?
«
Reply #6 on:
February 04, 2011, 05:21:32 PM »
al ready fix it
hope 1 of this days this new module add on to publish
Logged
Pages: [
1
]
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
=> Security Announcements
=> Documentation
=> WebsiteBaker Website Showcase
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
=====> Modules / Extensions
===> Suggestions
===> Software bugs
=> Help & Support
=> Modules
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
=> jQuery
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
=> Archive (posts up to 2007)
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
=====> Module / Extensions
===> Vorschläge
===> Softwarefehler
===> Erfahrungs und Testberichte
=> Hilfe/Support
=> Module & Snippets
=> Templates & Design
=> Tutorials
=> jQuery
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...