Free Billing, Routing and Management software for Asterisk and VOIP
Home | Forums | Wiki | Manual | Open Source | Billing and BSS | My Blue Heart | astbss.org
DownLoad | Bugs | Help Wanted | Numbering Plan
  
 

Access Denied

 
By bluegrass at Mon, 2006-11-13 04:13 | AstBill Software - General and Support

Hi all,

I have a fresh install of astbill on FC6 with all required modules for Apache2, MySQL5 and PHP5. When I login on the main page and click on any of the other links on main page I get the below error:
===========================================
Access denied
You are not authorized to access this page.
===========================================

Any idea how can I fix it?

Thanks in advance.

Ah this is the same problem

By Fibres on Tue, 2006-11-14 00:02

Ah this is the same problem that I am having see my previous post http://astbill.com/node/842.

I am still having this problem and have got nowhere in tryi to solve this. I am wondering if it is something to do with the version of mysql?? Have they changed something which is causing these problems.

Regards

» login to post comments

use PHP4

By Barnaba on Wed, 2007-01-10 11:13

AstBill doesn't suppport PHP5 as it ssems so you have to use PHP4 unless you can make the necessary changes yourself ;]

» login to post comments

Access denied problem dirty solution

By greekman on Sat, 2006-12-30 12:08

I am testing Astbill 0.9.16 on Opensuse 10.2 with PHP 5.2.

Get above mentioned error:

Access denied
You are not authorized to access this page.

This problem is coming from the Drupal with PHP 5.2.
There is existing patch for Drupal 4.7.4

http://drupal.org/node/102114
http://drupal.org/files/issues/session_2.patch

The version of Astbill 0.9.16 is using Drupal 4.6.3 as I saw it in drupalchangelog.txt.
Upgrading of Drupal components seemed to be a little bit tricky,I made a llitle dirty hack for me.

You have just to modify 2 functions in 2 files.

/wwwroot/includes/database.mysql.inc

//------------------------------------------------------------

function db_connect($url) {
$url = parse_url($url);

// Allow for non-standard MySQL port.
if (isset($url['port'])) {
$url['host'] = $url['host'] .':'. $url['port'];
}

$connection = mysql_connect($url['host'], $url['user'], $url['pass'], TRUE) or die(mysql_error());
mysql_select_db(substr($url['path'], 1)) or die('unable to select database');

// *** add this here ***

register_shutdown_function('session_write_close');

// *********************

return $connection;
}

//--------------------------------------------------------------

/wwwroot/includes/session.inc includes/session.inc

//--------------------------------------------------------------

function sess_read($key) {
global $user;

$result = db_query_range("SELECT u.*, s.* FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.sid = '%s' AND u.status < 3", $key, 0, 1);

if (!db_num_rows($result)) {
db_query("INSERT INTO {sessions} (sid, uid, hostname, timestamp) VALUES ('%s', 0, '%s', %d)", $key, $_SERVER["REMOTE_ADDR"], time());
$result = db_query("SELECT u.* FROM {users} u WHERE u.uid = 0");
}

$user = db_fetch_object($result);
$user = drupal_unpack($user);
$user->roles = array();

// ******** add this here *********

register_shutdown_function('session_write_close');

// ********************************

$result = db_query("SELECT r.rid, r.name FROM {role} r INNER JOIN {users_roles} ur ON ur.rid = r.rid WHERE ur.uid = %d", $user->uid);

while ($role = db_fetch_object($result)) {
$user->roles[$role->rid] = $role->name;
}

return !empty($user->session) ? $user->session : '';
}

//-------------------------------------------------------------

The correct way would be to upgrade Drupal components to latest version.But hope this help to someone to quick solve this problem.

» login to post comments

Solving of this problem

By kings_one on Tue, 2009-11-03 16:26

I SOLVED THIS PROBLEM FINALY. MANY SPECIAL THANKS FOR GREEKMAN!
NOW MY MANDRIVA 2009 WORK AS SERVER WITH:
1.ASTERISK
2.ASTBILL
3.DRUPAL
4.POSTFIX (AS MAIL SERVER)
5.PROFTPD(FTP SERVER)
6.ROUNDCUBEMAIL
7.PHPMYADMIN
8.WEBMIN

I'M VERY PROUD AND MANY THANKFUL OF ASTBILL, ASTERISK AND ALL WHO POST THERE YOUR ATTEMPTS.

CHEERS ALL!

» login to post comments

thanks greekman

By yaerka on Wed, 2009-03-04 06:58

my problem has solved after 1 weeks.

» login to post comments
  
BerliOS Developer LogoSourceForge.net Logo Drupal.org Logo