Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 05:11:18 PM

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
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: entry to the next admin page, sessions?  (Read 849 times)
djdeeno

Offline Offline

Posts: 51


« 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 Offline

Posts: 232



WWW
« 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 Offline

Posts: 51


« 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 Offline

Posts: 3147



WWW
« 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 Offline

Posts: 51


« Reply #4 on: February 04, 2011, 01:01:08 PM »

Thanks

Its working, great!!!

Mars
Logged
djdeeno

Offline Offline

Posts: 51


« 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 Offline

Posts: 51


« Reply #6 on: February 04, 2011, 05:21:32 PM »

al ready fix it  cheesy
hope 1 of this days this new module add on to publish
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!