The second error is due to the fact that you send html output before Prado can send a cookie to your browser, so lets focus on the blank screen.
Can you please send me the config file youre using? Are you using MySQL or SQLite? Which version are you using?
Brian Wong wrote:
>Hi, I am trying to get SVNManager to work. I think I ran into a Prado
>problem but I am not exactly sure. I am not a PHP programmer so I
>wasnt able to do much. When I access the first page all I get is a
>blank screen. When I modify the index.php and add 'echo $app;', I get
>this output...
>
>Object id #1
>Fatal Error
>
>[2] session_start() [function.session-start]: Cannot send session
>cookie - headers already sent by (output started at
>/svn/svnmanager/index.php:9) (@line 133 in file
>/svn/svnmanager/prado/TSession.php).
>Debug Backtrace
>
>#1 TSession.php:133 -- pradoErrorHandler(...)
>#2 TSession.php:133 -- session_start()
>#3 TApplication.php:439 -- TSession->start()
>#4 TApplication.php:468 -- TApplication->init()
>#5 index.php:10 -- TApplication->run()
>
>Also, i quite dont understand why SVNManager needs a database backend.
>Isnt all the information available through the htpasswd and svn-access
>file? If I cant get this working do you know of any other projects
>similar to your own? Thanks.
>
I think a database backend gives more flexibility to add features and some current features need additional storage besides these two files.
Second, I find it easier to use a database than extracting information from the accessfile, though I'm sure it's possible.
Further, when I started this project I couldn't find any similar project to scratch this itch! I would be pleased to know though!
Finally, would you please be so kind to use the forum next time? I will forward this message!
Kind regards,
Marijn Verkerk
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok Marijn, I was a bit premature with asking for help. I actually was trying to use SVNManager against a PostgreSQL backend. I fixed up your sql file so it would work, and gave it a whirl. I thought that the warning you gave in the config.php which read 'only MySQL and SQLite test' meant that most likely any PEAR supported DB would work. I didnt want to have to go back to MySQL, but I think I have an old instance running somewhere so I can verify its a DB error giving me the blank page. Is there a way I can get debugging output? If the DB incompatibility is the problem, how far down the road do you think pgsql support is? I have some experience with Pear DB and testing both MySQL and PostgreSQL in another project. Perhaps I can lend a hand if the possibility is in reach?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So i got SVNManager to work. Can someone try the diff below to see if it still works against MySQL? I made some changes so that it would work on PostgreSQL. The changes mostly consisted of avoiding insertion of an explicit 'null' for the 'id' fields. The breaks the NOT NULL constraint on PostgreSQL tables. May I ask what IDE you use that creates these files with dos newlines?
CREATE TABLE groupprivileges (
id serial NOT NULL,
groupid integer DEFAULT 0 NOT NULL,
repositoryid integer DEFAULT 0 NOT NULL,
"access" integer DEFAULT 0 NOT NULL,
path character varying(255) DEFAULT ''::character varying NOT NULL
);
CREATE TABLE groups (
id serial NOT NULL,
name character varying(32) DEFAULT ''::character varying NOT NULL,
adminid integer DEFAULT 0 NOT NULL
);
CREATE TABLE repositories (
id serial NOT NULL,
name character varying(32) DEFAULT ''::character varying NOT NULL,
ownerid integer DEFAULT 0 NOT NULL
);
CREATE TABLE userprivileges (
id serial NOT NULL,
userid integer DEFAULT 0 NOT NULL,
repositoryid integer DEFAULT 0 NOT NULL,
"access" integer DEFAULT 0 NOT NULL,
path character varying(255) DEFAULT ''::character varying NOT NULL
);
CREATE TABLE users (
id serial NOT NULL,
name character varying(32) DEFAULT ''::character varying NOT NULL,
"password" character varying(32) DEFAULT ''::character varying NOT NULL,
email character varying(128) DEFAULT ''::character varying NOT NULL,
admin integer DEFAULT 0 NOT NULL,
repositorygrants integer DEFAULT 0 NOT NULL
);
CREATE TABLE usersgroups (
userid integer DEFAULT 0 NOT NULL,
groupid integer DEFAULT 0 NOT NULL
);
CREATE TABLE usertickets (
email character varying(128) DEFAULT ''::character varying NOT NULL,
ticket character varying(32) DEFAULT ''::character varying NOT NULL,
repositorygrants integer DEFAULT 0 NOT NULL
);
ALTER TABLE ONLY groupprivileges
ADD CONSTRAINT groupprivileges_pkey PRIMARY KEY (id);
ALTER TABLE ONLY groups
ADD CONSTRAINT groups_pkey PRIMARY KEY (id);
ALTER TABLE ONLY repositories
ADD CONSTRAINT repositories_pkey PRIMARY KEY (id);
ALTER TABLE ONLY userprivileges
ADD CONSTRAINT userprivileges_pkey PRIMARY KEY (id);
ALTER TABLE ONLY users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- PostgreSQL database dump complete
--
-------------END OF createtablesPG.sql------------------
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
//SMTP Server for outgoing mail
$smtp_server = "jason.xxx.com";
//Data Source Name (only tested with mysql and sqlite!!)
//
// Use the createtables.sql script to build the tables in a mysql database
//
// An empty SQLite database will automatically be generated with the first
// startup!
//
After I change my php.ini to "display_errors = On"
I get error message on the first screen(index.php):
Fatal error: Only variables can be passed by reference in /usr/local/apache2/htdocs/svnmanager-0.36/prado-2.0.1/Web/UI/TPage.php on line 373
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just jumping in here... but I'm also seeing this exact same thing. I've enabled error logging and don't get any errors. I have the latest download with Prado-2.0.3. No content is returned at all (ie. empty http response).
BTW, Prado is a very interesting framework.. for me especially ;-)
Nevermind ;-)... Was missing the php-mysql rpm from my FC4 install... Which certainly begs the question of why I got no indication that this peice was missing. Shouldn't there have been an error or something like that? Oh well.. now I know ;-)
Hi there,
The second error is due to the fact that you send html output before Prado can send a cookie to your browser, so lets focus on the blank screen.
Can you please send me the config file youre using? Are you using MySQL or SQLite? Which version are you using?
Brian Wong wrote:
>Hi, I am trying to get SVNManager to work. I think I ran into a Prado
>problem but I am not exactly sure. I am not a PHP programmer so I
>wasnt able to do much. When I access the first page all I get is a
>blank screen. When I modify the index.php and add 'echo $app;', I get
>this output...
>
>Object id #1
>Fatal Error
>
>[2] session_start() [function.session-start]: Cannot send session
>cookie - headers already sent by (output started at
>/svn/svnmanager/index.php:9) (@line 133 in file
>/svn/svnmanager/prado/TSession.php).
>Debug Backtrace
>
>#1 TSession.php:133 -- pradoErrorHandler(...)
>#2 TSession.php:133 -- session_start()
>#3 TApplication.php:439 -- TSession->start()
>#4 TApplication.php:468 -- TApplication->init()
>#5 index.php:10 -- TApplication->run()
>
>Also, i quite dont understand why SVNManager needs a database backend.
>Isnt all the information available through the htpasswd and svn-access
>file? If I cant get this working do you know of any other projects
>similar to your own? Thanks.
>
I think a database backend gives more flexibility to add features and some current features need additional storage besides these two files.
Second, I find it easier to use a database than extracting information from the accessfile, though I'm sure it's possible.
Further, when I started this project I couldn't find any similar project to scratch this itch! I would be pleased to know though!
Finally, would you please be so kind to use the forum next time? I will forward this message!
Kind regards,
Marijn Verkerk
Ok Marijn, I was a bit premature with asking for help. I actually was trying to use SVNManager against a PostgreSQL backend. I fixed up your sql file so it would work, and gave it a whirl. I thought that the warning you gave in the config.php which read 'only MySQL and SQLite test' meant that most likely any PEAR supported DB would work. I didnt want to have to go back to MySQL, but I think I have an old instance running somewhere so I can verify its a DB error giving me the blank page. Is there a way I can get debugging output? If the DB incompatibility is the problem, how far down the road do you think pgsql support is? I have some experience with Pear DB and testing both MySQL and PostgreSQL in another project. Perhaps I can lend a hand if the possibility is in reach?
When turning "output_buffering = on" in php.in, then the "headers are already sent" errors will be gone.
This is a "problem" with prado and not with svnmanager.
Klaus
So i got SVNManager to work. Can someone try the diff below to see if it still works against MySQL? I made some changes so that it would work on PostgreSQL. The changes mostly consisted of avoiding insertion of an explicit 'null' for the 'id' fields. The breaks the NOT NULL constraint on PostgreSQL tables. May I ask what IDE you use that creates these files with dos newlines?
Index: svnmanager/global/SVNManagerUser.php
--- svnmanager/global/SVNManagerUser.php (revision 3)
+++ svnmanager/global/SVNManagerUser.php (revision 4)
@@ -121,7 +121,10 @@
$adodb->SetFetchMode("Associative");
$userid=$this->getId();
- $result = $adodb->Execute("SELECT * FROM users WHERE id='$userid'");
+ if(!$userid)
+ return false;
+
+ $result = $adodb->Execute('SELECT * FROM users WHERE id=?', array($userid));
$fields = $result->fields;
if($fields['repositorygrants']>0)
Index: svnmanager/GroupModule/DataModule.php
===================================================================
--- svnmanager/GroupModule/DataModule.php (revision 3)
+++ svnmanager/GroupModule/DataModule.php (revision 4)
@@ -20,7 +20,8 @@
public function getUsername($id)
{
- $user = $this->Database->Execute("SELECT * FROM users WHERE id='$id'");
+ //$user = $this->Database->Execute("SELECT * FROM users WHERE id='$id'");
+ $user = $this->Database->Execute('SELECT * FROM users WHERE id=?', array($id));
if($user)
return $user->fields['name'];
else
@@ -69,7 +70,7 @@
public function createGroup($name)
{
$userid = $this->User->getId();
- $result = $this->Database->Execute("INSERT INTO groups (id, name, adminid) VALUES (null, '$name', '$userid')");
+ $result = $this->Database->Execute("INSERT INTO groups (name, adminid) VALUES ('$name', '$userid')");
$groupid = $this->Database->Insert_ID();
$result->Close();
$this->rebuildAccessFile();
@@ -114,4 +115,4 @@
}
}
-?>
\ No newline at end of file
+?>
Index: svnmanager/UserModule/DataModule.php
===================================================================
--- svnmanager/UserModule/DataModule.php (revision 3)
+++ svnmanager/UserModule/DataModule.php (revision 4)
@@ -40,7 +40,8 @@
}
$md5_pw = md5($password);
- return $this->Database->Execute("INSERT INTO users (id, name, password, email, admin, repositorygrants) VALUES (null, '$name', '$md5_pw', '$email', '$admin', '$repositorygrants')");
+ //return $this->Database->Execute("INSERT INTO users (id, name, password, email, admin, repositorygrants) VALUES (null, '$name', '$md5_pw', '$email', '$admin', '$repositorygrants')");
+ return $this->Database->Execute("INSERT INTO users (name, password, email, admin, repositorygrants) VALUES ('$name', '$md5_pw', '$email', '$admin', '$repositorygrants')");
//return $this->Database->Execute("INSERT INTO users (name, password, email, admin, repositorygrants) VALUES ('$name', MD5('$password'), '$email', '$admin', '$repositorygrants')");
}
@@ -133,13 +134,12 @@
//Remove user from group(s)
$this->Database->Execute("DELETE FROM usersgroups WHERE userid='$id'");
+ $results = $this->Database->Execute("SELECT name FROM users WHERE id='$id'");
+ $name = $results->fields['name'];
//Remove user
$this->Database->Execute("DELETE FROM users WHERE id='$id'");
- $results = $this->Database->Execute("SELECT name FROM users WHERE id='$id'");
- $name = $results->fields['name'];
-
exec("$htpassword_cmd -D $svn_passwd_file $name");
$this->rebuildAccessfile();
@@ -167,4 +167,4 @@
}
-?>
\ No newline at end of file
+?>
Index: svnmanager/RepositoryModule/DataModule.php
===================================================================
--- svnmanager/RepositoryModule/DataModule.php (revision 3)
+++ svnmanager/RepositoryModule/DataModule.php (revision 4)
@@ -61,7 +61,8 @@
exec($svnadmin_cmd." create ".$dir);
//Add repository into database
- $result = $this->Database->Execute("INSERT INTO repositories (id, name, ownerid) VALUES (null, '$rname', '$userid')");
+ //$result = $this->Database->Execute("INSERT INTO repositories (id, name, ownerid) VALUES (null, '$rname', '$userid')");
+ $result = $this->Database->Execute("INSERT INTO repositories (name, ownerid) VALUES ('$rname', '$userid')");
//Rebuild accessfile
$this->rebuildAccessFile();
@@ -192,14 +193,16 @@
public function addUserPrivileges($userid, $repositoryid, $path, $access)
{
- $results = $this->Database->Execute("INSERT INTO userprivileges (id, userid, repositoryid, path, access) VALUES (null, '$userid', '$repositoryid', '$path', '$access')");
+ //$results = $this->Database->Execute("INSERT INTO userprivileges (id, userid, repositoryid, path, access) VALUES (null, '$userid', '$repositoryid', '$path', '$access')");
+ $results = $this->Database->Execute("INSERT INTO userprivileges (userid, repositoryid, path, access) VALUES ('$userid', '$repositoryid', '$path', '$access')");
$this->rebuildAccessFile();
}
public function addGroupPrivileges($groupid, $repositoryid, $path, $access)
{
- $results = $this->Database->Execute("INSERT INTO groupprivileges (id, groupid, repositoryid, path, access) VALUES (null, '$groupid', '$repositoryid', '$path', '$access')");
+ //$results = $this->Database->Execute("INSERT INTO groupprivileges (id, groupid, repositoryid, path, access) VALUES (null, '$groupid', '$repositoryid', '$path', '$access')");
+ $results = $this->Database->Execute("INSERT INTO groupprivileges (groupid, repositoryid, path, access) VALUES ('$groupid', '$repositoryid', '$path', '$access')");
$this->rebuildAccessFile();
}
@@ -232,4 +235,4 @@
}
-?>
\ No newline at end of file
+?>
Here is also a PostgreSQL schema dump.
--------------createtablesPG.sql-----------------------
--
-- PostgreSQL database dump
--
CREATE TABLE groupprivileges (
id serial NOT NULL,
groupid integer DEFAULT 0 NOT NULL,
repositoryid integer DEFAULT 0 NOT NULL,
"access" integer DEFAULT 0 NOT NULL,
path character varying(255) DEFAULT ''::character varying NOT NULL
);
CREATE TABLE groups (
id serial NOT NULL,
name character varying(32) DEFAULT ''::character varying NOT NULL,
adminid integer DEFAULT 0 NOT NULL
);
CREATE TABLE repositories (
id serial NOT NULL,
name character varying(32) DEFAULT ''::character varying NOT NULL,
ownerid integer DEFAULT 0 NOT NULL
);
CREATE TABLE userprivileges (
id serial NOT NULL,
userid integer DEFAULT 0 NOT NULL,
repositoryid integer DEFAULT 0 NOT NULL,
"access" integer DEFAULT 0 NOT NULL,
path character varying(255) DEFAULT ''::character varying NOT NULL
);
CREATE TABLE users (
id serial NOT NULL,
name character varying(32) DEFAULT ''::character varying NOT NULL,
"password" character varying(32) DEFAULT ''::character varying NOT NULL,
email character varying(128) DEFAULT ''::character varying NOT NULL,
admin integer DEFAULT 0 NOT NULL,
repositorygrants integer DEFAULT 0 NOT NULL
);
CREATE TABLE usersgroups (
userid integer DEFAULT 0 NOT NULL,
groupid integer DEFAULT 0 NOT NULL
);
CREATE TABLE usertickets (
email character varying(128) DEFAULT ''::character varying NOT NULL,
ticket character varying(32) DEFAULT ''::character varying NOT NULL,
repositorygrants integer DEFAULT 0 NOT NULL
);
ALTER TABLE ONLY groupprivileges
ADD CONSTRAINT groupprivileges_pkey PRIMARY KEY (id);
ALTER TABLE ONLY groups
ADD CONSTRAINT groups_pkey PRIMARY KEY (id);
ALTER TABLE ONLY repositories
ADD CONSTRAINT repositories_pkey PRIMARY KEY (id);
ALTER TABLE ONLY userprivileges
ADD CONSTRAINT userprivileges_pkey PRIMARY KEY (id);
ALTER TABLE ONLY users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- PostgreSQL database dump complete
--
-------------END OF createtablesPG.sql------------------
Hi Brain,
You found your way to the SQL queries spread out in this app. Yes, it's true, they should be all in the DataModule classes! :-)
Anyway, thanks a bunch for the effort. I will verify if these changes are compatible with SQLite and MySQL later!
Thanks again!
Marijn
Hi Marijn,
I have the same problem(blank screen)!
I'm currently running on SVNManger-0.36 with Mysql-4.1.12-2.FC4.1, PHP-5.0.5, httpd-2.0.54
Below is my config.php:
<?php
//Shell command's
$htpassword_cmd = "/usr/bin/htpasswd";
$svn_cmd = "/usr/bin/svn";
$svnadmin_cmd = "/usr/bin/svnadmin";
//Subversion locations
$svn_repos_loc = "/usr/local/apache2/htdocs/repos";
$svn_passwd_file = "/etc/subversion/passwd";
$svn_access_file = "/var/local/apache2/htdocs/repos/accessfile";
//SMTP Server for outgoing mail
$smtp_server = "jason.xxx.com";
//Data Source Name (only tested with mysql and sqlite!!)
//
// Use the createtables.sql script to build the tables in a mysql database
//
// An empty SQLite database will automatically be generated with the first
// startup!
//
$dsn = "mysql://root@localhost/svnmanager";
//$dsn = "sqlite://svnmanager.db";
//Administrator account
$admin_name = "admin";
$admin_temp_password = "admin";
?>
Kindly HELP!
PS: I have no problem install with default FC4(Mysql, PHP-5.0.4-10.4, & httpd-2.0.54-10.2
Found something new:
After I change my php.ini to "display_errors = On"
I get error message on the first screen(index.php):
Fatal error: Only variables can be passed by reference in /usr/local/apache2/htdocs/svnmanager-0.36/prado-2.0.1/Web/UI/TPage.php on line 373
Hi there!
The cause of this seems to be a bug in PHP, see the following site:
http://bugs.php.net/bug.php?id=33643
A quick fix could be downgrading to a previous version of php5!
Kind regards,
Marijn
Yeah! You are true :)
I have no problem with PHP 5.04
Just jumping in here... but I'm also seeing this exact same thing. I've enabled error logging and don't get any errors. I have the latest download with Prado-2.0.3. No content is returned at all (ie. empty http response).
BTW, Prado is a very interesting framework.. for me especially ;-)
Allen Bauer.
Delphi/C++Builder/C#Builder
Chief Scientist
Borland Software Corp.
http://blogs.borland.com/abauer
Nevermind ;-)... Was missing the php-mysql rpm from my FC4 install... Which certainly begs the question of why I got no indication that this peice was missing. Shouldn't there have been an error or something like that? Oh well.. now I know ;-)
Allen Bauer.
Delphi/C++Builder/C#Builder
Chief Scientist
Borland Software Corp.
http://blogs.borland.com/abauer