tutos-commits Mailing List for TUTOS (Page 11)
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(214) |
Sep
(144) |
Oct
(22) |
Nov
(22) |
Dec
(93) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(25) |
Feb
(31) |
Mar
(92) |
Apr
(70) |
May
(103) |
Jun
(130) |
Jul
(265) |
Aug
(325) |
Sep
(233) |
Oct
(244) |
Nov
(261) |
Dec
(157) |
2003 |
Jan
(101) |
Feb
(135) |
Mar
(148) |
Apr
(164) |
May
(53) |
Jun
(116) |
Jul
(149) |
Aug
(126) |
Sep
(45) |
Oct
(109) |
Nov
(36) |
Dec
(61) |
2004 |
Jan
(131) |
Feb
(236) |
Mar
(278) |
Apr
(259) |
May
(92) |
Jun
(110) |
Jul
(150) |
Aug
(64) |
Sep
(141) |
Oct
(141) |
Nov
(146) |
Dec
(65) |
2005 |
Jan
(70) |
Feb
(77) |
Mar
(129) |
Apr
(153) |
May
(161) |
Jun
(63) |
Jul
(42) |
Aug
(16) |
Sep
(30) |
Oct
(3) |
Nov
(8) |
Dec
(40) |
2006 |
Jan
(114) |
Feb
(16) |
Mar
(12) |
Apr
(15) |
May
(4) |
Jun
(9) |
Jul
(69) |
Aug
(27) |
Sep
(12) |
Oct
(80) |
Nov
(62) |
Dec
(41) |
2007 |
Jan
(34) |
Feb
(2) |
Mar
(38) |
Apr
(82) |
May
(61) |
Jun
(37) |
Jul
(16) |
Aug
(64) |
Sep
(7) |
Oct
(52) |
Nov
(18) |
Dec
(28) |
2008 |
Jan
(168) |
Feb
(26) |
Mar
(27) |
Apr
(19) |
May
(10) |
Jun
(58) |
Jul
(58) |
Aug
(91) |
Sep
(14) |
Oct
(23) |
Nov
(56) |
Dec
(38) |
2009 |
Jan
(58) |
Feb
(90) |
Mar
(204) |
Apr
(90) |
May
(27) |
Jun
(177) |
Jul
(116) |
Aug
(53) |
Sep
(42) |
Oct
(120) |
Nov
(51) |
Dec
(58) |
2010 |
Jan
(117) |
Feb
(231) |
Mar
(163) |
Apr
(90) |
May
(40) |
Jun
(139) |
Jul
(49) |
Aug
(118) |
Sep
(25) |
Oct
(80) |
Nov
(102) |
Dec
(99) |
2011 |
Jan
(176) |
Feb
(42) |
Mar
(60) |
Apr
(52) |
May
(30) |
Jun
(29) |
Jul
(27) |
Aug
(16) |
Sep
(51) |
Oct
(70) |
Nov
(63) |
Dec
(58) |
2012 |
Jan
(28) |
Feb
(26) |
Mar
(7) |
Apr
(12) |
May
(41) |
Jun
(61) |
Jul
(59) |
Aug
(38) |
Sep
(30) |
Oct
(28) |
Nov
(14) |
Dec
(31) |
2013 |
Jan
(24) |
Feb
(54) |
Mar
(45) |
Apr
(22) |
May
(35) |
Jun
(8) |
Jul
(18) |
Aug
(38) |
Sep
(11) |
Oct
(8) |
Nov
(19) |
Dec
(20) |
2014 |
Jan
(20) |
Feb
(22) |
Mar
(4) |
Apr
(6) |
May
(13) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
2015 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2016 |
Jan
(4) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(8) |
Aug
(13) |
Sep
(12) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2021 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <gok...@us...> - 2013-06-20 11:46:31
|
Revision: 1092 http://sourceforge.net/p/tutos/code/1092 Author: gokohnert Date: 2013-06-20 11:46:29 +0000 (Thu, 20 Jun 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/php/db/db_mysqli.pinc Modified: trunk/php/db/db_mysqli.pinc =================================================================== --- trunk/php/db/db_mysqli.pinc 2013-06-20 07:35:59 UTC (rev 1091) +++ trunk/php/db/db_mysqli.pinc 2013-06-20 11:46:29 UTC (rev 1092) @@ -251,7 +251,7 @@ $y = 3; while ($y <= $x) { $qa = 'set @a'.$y.' = '.func_get_arg($y-1); - $r = $this->exec ($qa,1); + $r = $this->exec ($qa,$err); if (is_object($r)) $r->free(); @@ -525,7 +525,7 @@ $c = preg_replace("/U/","unique",$c); $c = preg_replace("/NN/","",$c); $q .= $this->colname($colname) ." ". $this->colname($colname) ." ". $t ." ". $c; -# echo $q."<br />"; + # echo $q."<br />"; return $this->exec($q,0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-06-20 07:36:06
|
Revision: 1091 http://sourceforge.net/p/tutos/code/1091 Author: gokohnert Date: 2013-06-20 07:35:59 +0000 (Thu, 20 Jun 2013) Log Message: ----------- fixing auth Modified Paths: -------------- trunk/php/auth/auth_cmdline.pinc trunk/php/auth/auth_external.pinc trunk/php/auth/auth_google.pinc trunk/php/auth/auth_http.pinc trunk/php/auth/auth_ldap.pinc trunk/php/auth/auth_pam.pinc trunk/php/auth/auth_pwauth_db.pinc trunk/php/auth/auth_remoteuser.pinc trunk/php/auth/auth_typo3.pinc trunk/php/auth/auth_x509.pinc Modified: trunk/php/auth/auth_cmdline.pinc =================================================================== --- trunk/php/auth/auth_cmdline.pinc 2013-06-20 05:42:27 UTC (rev 1090) +++ trunk/php/auth/auth_cmdline.pinc 2013-06-20 07:35:59 UTC (rev 1091) @@ -1,11 +1,15 @@ <?php /** - * Copyright 2004 - 2013 by Gero Kohnert + * Copyright 2004 - 2013 by Gero Kohnert * - * authentification when called by commandline php + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. * - * SVN Info $Id$ - * $Author$ + * authentification when called by commandline php + * + * SVN Info $Id$ + * $Author$ */ $tutos['files'][__FILE__] = '$Rev$'; @@ -74,7 +78,7 @@ * using a DB query */ function check() { - global $current_user,$lang; + global $current_user,$lang,$table; // ready ? if ( ! $this->ready() ) { @@ -90,14 +94,14 @@ dterror_log('check cmdline '.$this->getuname()."\n", 3, $tutos[errlog]); - $q = "SELECT a.* ,p.*,p.id as u_id, p.creator as cr_a, p.creation as cr_t FROM ". $this->dbconn->prefix ."addresses a, ". $this->dbconn->prefix ."people p "; + $q = 'SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['people'][name].' p, '. $this->dbconn->prefix.$table['address'][name].' a WHERE'; if ($this->dbconn->prep) { - $q .= " WHERE p.login = $1 AND p.pw = $2 AND p.adr_id = a.id"; + $q .= ' p.login = $1 AND p.pw = $2 AND p.adr_id = a.id'; $this->dbconn->addPStatement($q,'LOGINCMD'); $result = $this->dbconn->execPStatement('LOGINCMD',0,$this->dbconn->String($this->getuname()),$this->dbconn->Password($this->getpw())); } else { - $q .= " WHERE p.login = ". $this->dbconn->String($this->getuname()); - $q .= " AND p.pw = ". $this->dbconn->Password($this->getpw()) ." AND p.adr_id = a.id"; + $q .= ' p.login = '. $this->dbconn->String($this->getuname()); + $q .= ' AND p.pw = '. $this->dbconn->Password($this->getpw()) .' AND p.adr_id = a.id'; $result = $this->dbconn->Exec($q); } $r = array(); Modified: trunk/php/auth/auth_external.pinc =================================================================== --- trunk/php/auth/auth_external.pinc 2013-06-20 05:42:27 UTC (rev 1090) +++ trunk/php/auth/auth_external.pinc 2013-06-20 07:35:59 UTC (rev 1091) @@ -1,12 +1,17 @@ <?php /* - * Copyright 2009 by Gero Kohnert + * Copyright 2009 - 2013 by Gero Kohnert * - * SVN Info $Id$ - * $Author$ + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. * + * SVN Info $Id$ + * $Author$ + * * Authentification using some external method */ +$tutos['files'][__FILE__] = '$Rev$'; require_once 'auth.pinc'; /** @@ -102,15 +107,20 @@ * using a DB query */ function check() { - global $current_user,$lang; + global $current_user,$lang,$table; - $q = "SELECT a.* ,p.*,p.id as u_id, p.creator as cr_a, p.creation as cr_t FROM ". $this->dbconn->prefix ."addresses a, ". $this->dbconn->prefix ."people p "; - $q .= " WHERE p.login = ". $this->dbconn->String($this->getuname()); - $q .= " AND p.adr_id = a.id"; - $result = $this->dbconn->Exec($q); + $q = 'SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['people'][name].' p, '. $this->dbconn->prefix.$table['address'][name].' a WHERE'; + if ($this->dbconn->prep) { + $q .= ' login = $1 AND p.adr_id = a.id'; + $this->dbconn->addPStatement($q,'LOGINEXT'); + $result = $this->dbconn->execPStatement('LOGINEXT',0,$this->dbconn->String($this->getuname())); + } else { + $q .= ' login = '.$this->dbconn->String($this->getuname()).' AND p.adr_id = a.id'; + $result = $this->dbconn->Exec($q); + } $r = array(); - if ( ! $result ) { + if ( ! $result || !is_object($result) ) { ReadLang($lang); $r[0] = "No Result for ". $this->getuname() ." / ". $this->getpw(); $r[1] = $lang['Err0026']; @@ -142,4 +152,4 @@ exit; } } -?> +?> \ No newline at end of file Modified: trunk/php/auth/auth_google.pinc =================================================================== --- trunk/php/auth/auth_google.pinc 2013-06-20 05:42:27 UTC (rev 1090) +++ trunk/php/auth/auth_google.pinc 2013-06-20 07:35:59 UTC (rev 1091) @@ -6,8 +6,8 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation; version 2 of the License. * - * SVN Info $Id: auth_pam.pinc 538 2012-02-15 09:42:21Z gokohnert $ - * $Author: gokohnert $ + * SVN Info $Id: auth_pam.pinc 538 2012-02-15 09:42:21Z gokohnert $ + * $Author: gokohnert $ */ $tutos['files'][__FILE__] = '$Rev: 949 $'; @@ -161,13 +161,18 @@ dterror_log('check google '.$this->user['email']."\n", 3, $tutos[errlog]); - $q = 'SELECT a.* ,p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['address'][name].' a, '. $this->dbconn->prefix .$table['people'][name].' p'; - $q .= ' WHERE p.google_email = '. $this->dbconn->String($this->user['email']); - $q .= ' AND p.adr_id = a.id'; + $q = 'SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['people'][name].' p, '. $this->dbconn->prefix.$table['address'][name].' a WHERE'; + if ($this->dbconn->prep) { + $q .= ' p.google_email = $1 AND p.adr_id = a.id'; + $this->dbconn->addPStatement($q,'LOGINGOOGLE'); + $result = $this->dbconn->execPStatement('LOGINGOOGLE',0,$this->dbconn->String($this->user['email'])); + } else { + $q .= ' p.google_email = '.$this->dbconn->String($this->user['email']).' AND p.adr_id = a.id'; + $result = $this->dbconn->Exec($q); + } - $result = $this->dbconn->Exec($q); $r = array(); - if ( ! $result ) { + if ( ! $result || !is_object($result)) { ReadLang($lang); $r[0] = 'No Result for "'. $this->getuname() ; $r[1] = $lang['Err0026']; Modified: trunk/php/auth/auth_http.pinc =================================================================== --- trunk/php/auth/auth_http.pinc 2013-06-20 05:42:27 UTC (rev 1090) +++ trunk/php/auth/auth_http.pinc 2013-06-20 07:35:59 UTC (rev 1091) @@ -1,9 +1,13 @@ <?php -/* - * Copyright 1999 - 2013 by Gero Kohnert +/** + * Copyright 1999 - 2013 by Gero Kohnert * - * SVN Info $Id$ - * $Author$ + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. + * + * SVN Info $Id$ + * $Author$ */ $tutos['files'][__FILE__] = '$Rev$'; @@ -103,16 +107,16 @@ * using a DB query */ function check() { - global $current_user,$lang; + global $current_user,$lang,$table; - $q = "SELECT a.* ,p.*,p.id as u_id FROM ". $this->dbconn->prefix ."addresses a, ". $this->dbconn->prefix ."people p "; + $q = 'SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['people'][name].' p, '. $this->dbconn->prefix.$table['address'][name].' a WHERE'; if ($this->dbconn->prep) { - $q .= " WHERE p.login = $1 AND p.pw = $2 AND p.adr_id = a.id"; + $q .= ' p.login = $1 AND p.pw = $2 AND p.adr_id = a.id'; $this->dbconn->addPStatement($q,'LOGINHTTP'); $result = $this->dbconn->execPStatement('LOGINHTTP',0,$this->dbconn->String($this->getuname()),$this->dbconn->Password($this->getpw())); } else { - $q .= " WHERE p.login = ". $this->dbconn->String($this->getuname()); - $q .= " AND p.pw = ". $this->dbconn->Password($this->getpw()) ." AND p.adr_id = a.id"; + $q .= ' p.login = '. $this->dbconn->String($this->getuname()); + $q .= ' AND p.pw = '. $this->dbconn->Password($this->getpw()) .' AND p.adr_id = a.id'; $result = $this->dbconn->Exec($q); } Modified: trunk/php/auth/auth_ldap.pinc =================================================================== --- trunk/php/auth/auth_ldap.pinc 2013-06-20 05:42:27 UTC (rev 1090) +++ trunk/php/auth/auth_ldap.pinc 2013-06-20 07:35:59 UTC (rev 1091) @@ -6,11 +6,11 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation; version 2 of the License. * - * SVN Info $Id$ - * $Author$ + * SVN Info $Id$ + * $Author$ * - * code by Dimitri Fontaine <dfo...@cv...> - * Patches and ldap filter by Frederic Olivie <al...@cl...> + * code by Dimitri Fontaine <dfo...@cv...> + * Patches and ldap filter by Frederic Olivie <al...@cl...> */ $tutos['files'][__FILE__] = '$Rev$'; @@ -126,12 +126,16 @@ dterror_log('check ldap '.$this->getuname()."\n", 3, $tutos[errlog]); - $query = 'SELECT a.* ,p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['address'][name].' a, '. $this->dbconn->prefix .$table['people'][name].' p'; - $query .= " WHERE p.login = ". $this->dbconn->String($this->getuname()); - $query .= " AND p.adr_id = a.id"; + $q = 'SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['people'][name].' p, '. $this->dbconn->prefix.$table['address'][name].' a WHERE'; + if ($this->dbconn->prep) { + $q .= ' login = $1 AND p.adr_id = a.id'; + $this->dbconn->addPStatement($q,'LOGINLDAP'); + $result = $this->dbconn->execPStatement('LOGINLDAP',0,$this->dbconn->String($this->getuname())); + } else { + $q .= ' login = '.$this->dbconn->String($this->getuname()).' AND p.adr_id = a.id'; + $result = $this->dbconn->Exec($q); + } - $result = $this->dbconn->Exec($query); - if ( ! $result ) { ReadLang($lang); $r[0] = "No Result for ". $this->getuname() ." / ". $this->getpw(); Modified: trunk/php/auth/auth_pam.pinc =================================================================== --- trunk/php/auth/auth_pam.pinc 2013-06-20 05:42:27 UTC (rev 1090) +++ trunk/php/auth/auth_pam.pinc 2013-06-20 07:35:59 UTC (rev 1091) @@ -95,18 +95,18 @@ * using a DB query checked against PAM (Pluggable Auth Module) */ function check() { - global $current_user,$lang,$tutos; + global $current_user,$lang,$tutos,$table; $r = array(); - $query = 'SELECT a.* ,p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['address'][name].' a, '. $this->dbconn->prefix .$table['people'][name].' p'; + $query = 'SELECT a.* ,p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['address'][name].' a, '. $this->dbconn->prefix .$table['people'][name].' p WHERE'; if ($this->dbconn->prep) { - $query .= " WHERE p.login = $1 AND p.adr_id = a.id"; + $query .= ' p.login = $1 AND p.adr_id = a.id'; $this->dbconn->addPStatement($q,'LOGINPAM'); $result = $this->dbconn->execPStatement('LOGINPAM',0,$this->dbconn->String($this->getuname())); } else { - $query .= " WHERE p.login = ". $this->dbconn->String($this->getuname()); - $query .= " AND p.adr_id = a.id"; + $query .= ' WHERE p.login = '. $this->dbconn->String($this->getuname()); + $query .= ' AND p.adr_id = a.id'; $result = $this->dbconn->Exec($query); } Modified: trunk/php/auth/auth_pwauth_db.pinc =================================================================== --- trunk/php/auth/auth_pwauth_db.pinc 2013-06-20 05:42:27 UTC (rev 1090) +++ trunk/php/auth/auth_pwauth_db.pinc 2013-06-20 07:35:59 UTC (rev 1091) @@ -61,7 +61,7 @@ * using a DB query */ function check() { - global $current_user,$lang,$tutos; + global $current_user,$lang,$tutos,$table; $r = array(); if (!isset($tutos['pwauth'])) die('$tutos[\'pwauth\'] does not exist'); @@ -70,14 +70,14 @@ if (!file_exists($pw)) die($pw.' does not exist'); if (!is_executable($pw)) die($pw.' is not executable'); - $q = "SELECT a.* ,p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM ". $this->dbconn->prefix ."addresses a, ". $this->dbconn->prefix ."people p "; + $q = 'SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['people'][name].' p, '. $this->dbconn->prefix.$table['address'][name].' a WHERE'; if ($this->dbconn->prep) { - $q .= " WHERE p.login = $1 AND p.adr_id = a.id"; + $q .= ' p.login = $1 AND p.adr_id = a.id'; $this->dbconn->addPStatement($q,'LOGINPWAUTH'); $result = $this->dbconn->execPStatement('LOGINPWAUTH',0,$this->dbconn->String($this->getuname())); } else { - $q .= " WHERE p.login = ". $this->dbconn->String($this->getuname()) ; - $q .= " AND p.adr_id = a.id"; + $q .= ' WHERE p.login = '. $this->dbconn->String($this->getuname()) ; + $q .= ' AND p.adr_id = a.id'; $result = $this->dbconn->Exec($q); } if ( ! $result || !is_object($result)) { @@ -119,12 +119,20 @@ $result->free(); error_log('===> pwauth_db '.$this->getUname().' returned '.$x." ==> fallback to db\n",3,$tutos[errlog]); // fallback - $q = "SELECT a.* ,p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM ". $this->dbconn->prefix ."addresses a, ". $this->dbconn->prefix ."people p "; - $q .= " WHERE p.login = ". $this->dbconn->String($this->getuname()) ; - $q .= " AND p.pw = ". $this->dbconn->Password($this->getpw()) ." AND p.adr_id = a.id"; - $result = $this->dbconn->Exec($q); - - if ( ! $result ) { + $q = 'SELECT a.* ,p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['address'][name].' a, '. $this->dbconn->prefix .$table['people'][name].' p'; + if ($this->dbconn->prep) { + $q .= ' WHERE p.login = $1'; + $q .= ' AND p.pw = $2'; + $q .= ' AND p.adr_id = a.id'; + $this->dbconn->addPStatement($q,'LOGIN'); + $result = $this->dbconn->execPStatement('LOGIN',0,$this->dbconn->String($this->getuname()),$this->dbconn->Password($this->getpw())); + } else { + $q .= ' WHERE p.login = '. $this->dbconn->String($this->getuname()) ; + $q .= ' AND p.pw = '. $this->dbconn->Password($this->getpw()); + $q .= ' AND p.adr_id = a.id'; + $result = $this->dbconn->Exec($q); + } + if ( ! $result || !is_object($result)) { ReadLang($lang); $r[0] = 'No Result for "'. $this->getuname() .'"/"'. $this->getpw(); $r[1] = $lang['Err0026']; Modified: trunk/php/auth/auth_remoteuser.pinc =================================================================== --- trunk/php/auth/auth_remoteuser.pinc 2013-06-20 05:42:27 UTC (rev 1090) +++ trunk/php/auth/auth_remoteuser.pinc 2013-06-20 07:35:59 UTC (rev 1091) @@ -1,10 +1,14 @@ <?php -/* - * Copyright 1999 - 2013 by Gero Kohnert +/** + * Copyright 1999 - 2013 by Gero Kohnert * - * SVN Info: $Id$ - * $Author$ - * contributed by Sebastian Brab\xE4nder + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. + * + * SVN Info: $Id$ + * $Author$ + * contributed by Sebastian Brab\xE4nder */ $tutos['files'][__FILE__] = '$Rev$'; @@ -88,7 +92,7 @@ * using external HTTP authentication */ Function check() { - global $current_user,$lang; + global $current_user,$lang,$table; if ( !$this->getuname()) { ReadLang($lang); @@ -97,15 +101,18 @@ return $r; } - $query = - "SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM ". $this->dbconn->prefix ."people p, ". $this->dbconn->prefix ."addresses a ". - "WHERE login = ". $this->dbconn->String($this->getuname()). - " AND p.adr_id = a.id"; + $q = 'SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['people'][name].' p, '. $this->dbconn->prefix.$table['address'][name].' a WHERE'; + if ($this->dbconn->prep) { + $q .= ' login = $1 AND p.adr_id = a.id'; + $this->dbconn->addPStatement($q,'LOGINREMOTE'); + $result = $this->dbconn->execPStatement('LOGINREMOTE',0,$this->dbconn->String($this->getuname())); + } else { + $q .= ' login = '.$this->dbconn->String($this->getuname()).' AND p.adr_id = a.id'; + $result = $this->dbconn->Exec($q); + } - $result = $this->dbconn->Exec($query); - $r = array(); - if ( ! $result ) { + if ( ! $result || !is_object($result)) { ReadLang($lang); $r[0] = "No Result for ". $this->getuname(); $r[1] = $lang['Err0026']; @@ -126,4 +133,4 @@ return true; } } -?> +?> \ No newline at end of file Modified: trunk/php/auth/auth_typo3.pinc =================================================================== --- trunk/php/auth/auth_typo3.pinc 2013-06-20 05:42:27 UTC (rev 1090) +++ trunk/php/auth/auth_typo3.pinc 2013-06-20 07:35:59 UTC (rev 1091) @@ -1,13 +1,13 @@ <?php -/* - * Copyright 2009 - 2011 by Gero Kohnert +/** + * Copyright 2009 - 2013 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; version 2 of the License. * - * SVN Info $Id$ - * $Author$ + * SVN Info $Id$ + * $Author$ */ $tutos['files'][__FILE__] = '$Rev$'; @@ -49,21 +49,25 @@ } return; } + /** * Check for permmision * using a DB query */ function check() { - global $current_user,$tutos,$lang; + global $current_user,$tutos,$lang,$table; - $query = - "SELECT p.*, a.* FROM ". $this->dbconn->prefix ."people p, ". $this->dbconn->prefix ."addresses a ". - "WHERE login = ". $this->dbconn->String($this->getuname()). - " AND p.adr_id = a.id"; + $q = 'SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['people'][name].' p, '. $this->dbconn->prefix.$table['address'][name].' a WHERE'; + if ($this->dbconn->prep) { + $q .= ' login = $1 AND p.adr_id = a.id'; + $this->dbconn->addPStatement($q,'LOGINTYPO3'); + $result = $this->dbconn->execPStatement('LOGINTYPO3',0,$this->dbconn->String($this->getuname())); + } else { + $q .= ' login = '.$this->dbconn->String($this->getuname()).' AND p.adr_id = a.id'; + $result = $this->dbconn->Exec($q); + } - $result = $this->dbconn->Exec($query); - - if ( ! $result ) { + if ( ! $result || !is_object($result) ) { ReadLang($lang); $r[0] = "No Result for ". $this->getuname() ." / ". $this->getpw(); $r[1] = $lang['Err0026']; @@ -138,4 +142,4 @@ $_SESSION['pwc'] = false; } } -?> +?> \ No newline at end of file Modified: trunk/php/auth/auth_x509.pinc =================================================================== --- trunk/php/auth/auth_x509.pinc 2013-06-20 05:42:27 UTC (rev 1090) +++ trunk/php/auth/auth_x509.pinc 2013-06-20 07:35:59 UTC (rev 1091) @@ -1,14 +1,14 @@ <?php /** - * Copyright 1999 - 2011 by Gero Kohnert + * Copyright 1999 - 2013 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; version 2 of the License. * - * SVN Info $Id$ - * $Author$ - * contributed by Markus Leist + * SVN Info $Id$ + * $Author$ + * contributed by Markus Leist */ $tutos['files'][__FILE__] = '$Rev$'; @@ -126,7 +126,7 @@ * using X.509v3-Certs */ Function check() { - global $tutos,$current_user,$lang; + global $tutos,$current_user,$lang,$table; if ( !$this->ready() ) { /* No Username or no password supplied */ @@ -142,7 +142,7 @@ dterror_log('check x509 '.$_SERVER["SSL_CLIENT_S_DN_Email"]."\n", 3, $tutos[errlog]); - $q = 'SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .'people p, '. $this->dbconn->prefix .'addresses a WHERE'; + $q = 'SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['people'][name].' p, '. $this->dbconn->prefix.$table['address'][name].' a WHERE'; if ($this->dbconn->prep) { $q .= ' login = $1 AND p.adr_id = a.id'; $this->dbconn->addPStatement($q,'LOGINX509'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-06-20 05:42:29
|
Revision: 1090 http://sourceforge.net/p/tutos/code/1090 Author: gokohnert Date: 2013-06-20 05:42:27 +0000 (Thu, 20 Jun 2013) Log Message: ----------- support onennote urls Modified Paths: -------------- trunk/php/webelements.p3 Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2013-06-20 05:41:29 UTC (rev 1089) +++ trunk/php/webelements.p3 2013-06-20 05:42:27 UTC (rev 1090) @@ -1018,7 +1018,7 @@ // $b = preg_replace('#<([BIU])>#im' ,'<$1>',$b); // $b = preg_replace('#</([BIU])>#im' ,'</$1>',$b); - $b = preg_replace('#(ftp|http|https):(//([.]?[a-z,0-9_\#/+-?&%=:])*)#im','<a href="$1:$2" target="_blank">$1:$2</a>',$b); + $b = preg_replace('#(ftp|http|https|onenote):(//([.]?[a-z,0-9_\#/+-?&%=:])*)#im','<a href="$1:$2" target="_blank">$1:$2</a>',$b); $b = preg_replace('#(file:/[\$a-z,0-9_\#:/?&=_.+-]*)#im','<a href="$1" target="_blank">$1</a>',$b); return $b; } @@ -1141,6 +1141,9 @@ if ( strstr($href,'file:') ) { return $href; } + if ( strstr($href,'onenote:') ) { + return $href; + } if ( strstr($href,'ftp:') ) { return $href; } @@ -1244,7 +1247,7 @@ if (empty($href)) { return $text; } - if ( ! preg_match('#^(JavaScript:|http:|https:|mailto:|ftp:|gopher:|file:|meet:|[a-z]:|\./)#im',$href) ) { + if ( ! preg_match('#^(JavaScript:|http:|https:|mailto:|ftp:|gopher:|file:|meet:|onenote:|[a-z]:|\./)#im',$href) ) { $href = addSessionKey(trim($href),false); $href = $tutos['base'] .'/php/'. $href; } @@ -1285,7 +1288,7 @@ $target= ' '.$target; } - if ( ! preg_match('#^(JavaScript:|http:|https:|mailto:|ftp:|gopher:|file:|meet:|[a-z]:|\./)#im',$href) ) { + if ( ! preg_match('#^(JavaScript:|http:|https:|mailto:|ftp:|gopher:|file:|meet:|onenote:|[a-z]:|\./)#im',$href) ) { $href = addSessionKey($href,false); $href = $tutos['base'] .'/php/'. $href; } @@ -1331,7 +1334,7 @@ global $tutos, $current_user; $href = addSessionKey($href,false); - if ( ! preg_match('#^(http:|https:|mailto:|ftp:|gopher:|file:|meet:|\./)#im',$href) ) { + if ( ! preg_match('#^(http:|https:|mailto:|ftp:|gopher:|file:|onenote:|meet:|\./)#im',$href) ) { $href = $tutos['base'] .'/php/'. $href; } @@ -3695,4 +3698,4 @@ return join("\n",$out); } -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-06-20 05:41:33
|
Revision: 1089 http://sourceforge.net/p/tutos/code/1089 Author: gokohnert Date: 2013-06-20 05:41:29 +0000 (Thu, 20 Jun 2013) Log Message: ----------- no more injection Modified Paths: -------------- trunk/php/auth/auth_pwauth_db.pinc Modified: trunk/php/auth/auth_pwauth_db.pinc =================================================================== --- trunk/php/auth/auth_pwauth_db.pinc 2013-06-19 14:14:21 UTC (rev 1088) +++ trunk/php/auth/auth_pwauth_db.pinc 2013-06-20 05:41:29 UTC (rev 1089) @@ -71,11 +71,16 @@ if (!is_executable($pw)) die($pw.' is not executable'); $q = "SELECT a.* ,p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM ". $this->dbconn->prefix ."addresses a, ". $this->dbconn->prefix ."people p "; - $q .= " WHERE p.login = ". $this->dbconn->String($this->getuname()) ; - $q .= " AND p.adr_id = a.id"; - $result = $this->dbconn->Exec($q); - - if ( ! $result ) { + if ($this->dbconn->prep) { + $q .= " WHERE p.login = $1 AND p.adr_id = a.id"; + $this->dbconn->addPStatement($q,'LOGINPWAUTH'); + $result = $this->dbconn->execPStatement('LOGINPWAUTH',0,$this->dbconn->String($this->getuname())); + } else { + $q .= " WHERE p.login = ". $this->dbconn->String($this->getuname()) ; + $q .= " AND p.adr_id = a.id"; + $result = $this->dbconn->Exec($q); + } + if ( ! $result || !is_object($result)) { ReadLang($lang); $r[0] = 'No Result for "'. $this->getuname() .'"/"'. $this->getpw(); $r[1] = $lang['Err0026']; @@ -146,4 +151,4 @@ return true; } } -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-06-19 14:14:29
|
Revision: 1088 http://sourceforge.net/p/tutos/code/1088 Author: gokohnert Date: 2013-06-19 14:14:21 +0000 (Wed, 19 Jun 2013) Log Message: ----------- anti injection measurements Modified Paths: -------------- trunk/php/auth/auth_cmdline.pinc trunk/php/auth/auth_db.pinc trunk/php/auth/auth_http.pinc trunk/php/auth/auth_pam.pinc trunk/php/auth/auth_x509.pinc Modified: trunk/php/auth/auth_cmdline.pinc =================================================================== --- trunk/php/auth/auth_cmdline.pinc 2013-06-17 11:28:55 UTC (rev 1087) +++ trunk/php/auth/auth_cmdline.pinc 2013-06-19 14:14:21 UTC (rev 1088) @@ -91,12 +91,17 @@ dterror_log('check cmdline '.$this->getuname()."\n", 3, $tutos[errlog]); $q = "SELECT a.* ,p.*,p.id as u_id, p.creator as cr_a, p.creation as cr_t FROM ". $this->dbconn->prefix ."addresses a, ". $this->dbconn->prefix ."people p "; - $q .= " WHERE p.login = ". $this->dbconn->String($this->getuname()); - $q .= " AND p.pw = ". $this->dbconn->Password($this->getpw()) ." AND p.adr_id = a.id"; - $result = $this->dbconn->Exec($q); - + if ($this->dbconn->prep) { + $q .= " WHERE p.login = $1 AND p.pw = $2 AND p.adr_id = a.id"; + $this->dbconn->addPStatement($q,'LOGINCMD'); + $result = $this->dbconn->execPStatement('LOGINCMD',0,$this->dbconn->String($this->getuname()),$this->dbconn->Password($this->getpw())); + } else { + $q .= " WHERE p.login = ". $this->dbconn->String($this->getuname()); + $q .= " AND p.pw = ". $this->dbconn->Password($this->getpw()) ." AND p.adr_id = a.id"; + $result = $this->dbconn->Exec($q); + } $r = array(); - if ( ! $result ) { + if ( ! $result || !is_object($result) ) { ReadLang($lang); $r[0] = "No Result for ". $this->getuname() ." / ". $this->getpw(); $r[1] = $lang['Err0026']; @@ -139,4 +144,4 @@ exit; } } -?> +?> \ No newline at end of file Modified: trunk/php/auth/auth_db.pinc =================================================================== --- trunk/php/auth/auth_db.pinc 2013-06-17 11:28:55 UTC (rev 1087) +++ trunk/php/auth/auth_db.pinc 2013-06-19 14:14:21 UTC (rev 1088) @@ -76,15 +76,22 @@ } //dterror_log('check db '.$this->getuname()."\n", 3, $tutos[errlog]); - $q = 'SELECT a.* ,p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['address'][name].' a, '. $this->dbconn->prefix .$table['people'][name].' p'; - $q .= ' WHERE p.login = '. $this->dbconn->String($this->getuname()) ; - $q .= ' AND p.pw = '. $this->dbconn->Password($this->getpw()); - $q .= ' AND p.adr_id = a.id'; - $result = $this->dbconn->Exec($q); + if ($this->dbconn->prep) { + $q .= ' WHERE p.login = $1'; + $q .= ' AND p.pw = $2'; + $q .= ' AND p.adr_id = a.id'; + $this->dbconn->addPStatement($q,'LOGIN'); + $result = $this->dbconn->execPStatement('LOGIN',0,$this->dbconn->String($this->getuname()),$this->dbconn->Password($this->getpw())); + } else { + $q .= ' WHERE p.login = '. $this->dbconn->String($this->getuname()) ; + $q .= ' AND p.pw = '. $this->dbconn->Password($this->getpw()); + $q .= ' AND p.adr_id = a.id'; + $result = $this->dbconn->Exec($q); + } $r = array(); - if ( ! $result ) { + if ( ! $result || !is_object($result) ) { ReadLang($lang); $r[0] = 'No Result for "'. $this->getuname() .'"/"'. $this->getpw(); $r[1] = $lang['Err0026']; Modified: trunk/php/auth/auth_http.pinc =================================================================== --- trunk/php/auth/auth_http.pinc 2013-06-17 11:28:55 UTC (rev 1087) +++ trunk/php/auth/auth_http.pinc 2013-06-19 14:14:21 UTC (rev 1088) @@ -106,12 +106,18 @@ global $current_user,$lang; $q = "SELECT a.* ,p.*,p.id as u_id FROM ". $this->dbconn->prefix ."addresses a, ". $this->dbconn->prefix ."people p "; - $q .= " WHERE p.login = ". $this->dbconn->String($this->getuname()); - $q .= " AND p.pw = ". $this->dbconn->Password($this->getpw()) ." AND p.adr_id = a.id"; - $result = $this->dbconn->Exec($q); + if ($this->dbconn->prep) { + $q .= " WHERE p.login = $1 AND p.pw = $2 AND p.adr_id = a.id"; + $this->dbconn->addPStatement($q,'LOGINHTTP'); + $result = $this->dbconn->execPStatement('LOGINHTTP',0,$this->dbconn->String($this->getuname()),$this->dbconn->Password($this->getpw())); + } else { + $q .= " WHERE p.login = ". $this->dbconn->String($this->getuname()); + $q .= " AND p.pw = ". $this->dbconn->Password($this->getpw()) ." AND p.adr_id = a.id"; + $result = $this->dbconn->Exec($q); + } $r = array(); - if ( ! $result ) { + if ( ! $result || !is_object($result) ) { ReadLang($lang); $r[0] = "No Result for ". $this->getuname() ." / ". $this->getpw(); $r[1] = $lang['Err0026']; @@ -146,4 +152,4 @@ exit; } } -?> +?> \ No newline at end of file Modified: trunk/php/auth/auth_pam.pinc =================================================================== --- trunk/php/auth/auth_pam.pinc 2013-06-17 11:28:55 UTC (rev 1087) +++ trunk/php/auth/auth_pam.pinc 2013-06-19 14:14:21 UTC (rev 1088) @@ -100,12 +100,17 @@ $r = array(); $query = 'SELECT a.* ,p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['address'][name].' a, '. $this->dbconn->prefix .$table['people'][name].' p'; - $query .= " WHERE p.login = ". $this->dbconn->String($this->getuname()); - $query .= " AND p.adr_id = a.id"; + if ($this->dbconn->prep) { + $query .= " WHERE p.login = $1 AND p.adr_id = a.id"; + $this->dbconn->addPStatement($q,'LOGINPAM'); + $result = $this->dbconn->execPStatement('LOGINPAM',0,$this->dbconn->String($this->getuname())); + } else { + $query .= " WHERE p.login = ". $this->dbconn->String($this->getuname()); + $query .= " AND p.adr_id = a.id"; + $result = $this->dbconn->Exec($query); + } - $result = $this->dbconn->Exec($query); - - if ( ! $result ) { + if ( ! $result || !is_object($result)) { ReadLang($lang); $r[0] = "No Result for ". $this->getuname() ." / ". $this->getpw(); $r[1] = $lang['Err0026']; Modified: trunk/php/auth/auth_x509.pinc =================================================================== --- trunk/php/auth/auth_x509.pinc 2013-06-17 11:28:55 UTC (rev 1087) +++ trunk/php/auth/auth_x509.pinc 2013-06-19 14:14:21 UTC (rev 1088) @@ -142,15 +142,18 @@ dterror_log('check x509 '.$_SERVER["SSL_CLIENT_S_DN_Email"]."\n", 3, $tutos[errlog]); - $query = - "SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM ". $this->dbconn->prefix ."people p, ". $this->dbconn->prefix ."addresses a ". - "WHERE login = ". $this->dbconn->String($this->getuname()). - " AND p.adr_id = a.id"; + $q = 'SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .'people p, '. $this->dbconn->prefix .'addresses a WHERE'; + if ($this->dbconn->prep) { + $q .= ' login = $1 AND p.adr_id = a.id'; + $this->dbconn->addPStatement($q,'LOGINX509'); + $result = $this->dbconn->execPStatement('LOGINX509',0,$this->dbconn->String($this->getuname())); + } else { + $q .= ' login = '.$this->dbconn->String($this->getuname()).' AND p.adr_id = a.id'; + $result = $this->dbconn->Exec($q); + } - $result = $this->dbconn->Exec($query); - $r = array(); - if ( ! $result ) { + if ( ! $result || !is_object($result)) { ReadLang($lang); $r[0] = "No Result for ". $this->getuname(); $r[1] = $lang['Err0026']; @@ -174,4 +177,4 @@ return true; } } -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-06-17 11:28:58
|
Revision: 1087 http://sourceforge.net/p/tutos/code/1087 Author: gokohnert Date: 2013-06-17 11:28:55 +0000 (Mon, 17 Jun 2013) Log Message: ----------- works without iconv Modified Paths: -------------- trunk/php/subversion/svn.pinc Modified: trunk/php/subversion/svn.pinc =================================================================== --- trunk/php/subversion/svn.pinc 2013-06-05 14:33:07 UTC (rev 1086) +++ trunk/php/subversion/svn.pinc 2013-06-17 11:28:55 UTC (rev 1087) @@ -337,7 +337,7 @@ while(!feof($p)) { $this->log .= fread($p,1024); } - $this->log = trim(myiconv($this->log)); + $this->log = trim($this->log); pclose($p); $this->revdate = ''; @@ -778,4 +778,4 @@ } } -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-06-05 14:33:12
|
Revision: 1086 http://sourceforge.net/p/tutos/code/1086 Author: gokohnert Date: 2013-06-05 14:33:07 +0000 (Wed, 05 Jun 2013) Log Message: ----------- file handling for log files Modified Paths: -------------- trunk/php/file/file.pinc Modified: trunk/php/file/file.pinc =================================================================== --- trunk/php/file/file.pinc 2013-05-27 15:15:27 UTC (rev 1085) +++ trunk/php/file/file.pinc 2013-06-05 14:33:07 UTC (rev 1086) @@ -725,6 +725,7 @@ && !preg_match('#message/rfc822#',$this->filetype) && !preg_match("#\.ini$#i",$this->filename) && !preg_match("#\.txt$#i",$this->filename) + && !preg_match("#\.log$#i",$this->filename) ) { return ''; } @@ -846,7 +847,8 @@ Header("Content-Description: ". $this->name ); if ( $this->filetype == 'text/plain' || $this->filetype == 'text/x-log' - || $this->filetype == 'text/html' ) { + || $this->filetype == 'text/html' + ) { Header("Content-type: ". $this->filetype); Header("Content-Disposition: inline; filename=\"". $this->filename ."\""); $this->myreadfile ($fname); @@ -1000,7 +1002,10 @@ $r .= $a->getasText($lang)."\r\n"; } return $r; - } else if ( preg_match("#\.ini$#i",$this->filename) || preg_match("#\.txt$#i",$this->filename) ) { + } else if ( preg_match("#\.ini$#i",$this->filename) + || preg_match("#\.txt$#i",$this->filename) + || preg_match("#\.log$#i",$this->filename) + ) { Header("Content-type: text/plain"); Header("Content-Disposition: inline; filename=\"". $this->filename ."\""); $this->myreadfile ($fname); @@ -1857,4 +1862,4 @@ } } -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-27 15:15:32
|
Revision: 1085 http://sourceforge.net/p/tutos/code/1085 Author: gokohnert Date: 2013-05-27 15:15:27 +0000 (Mon, 27 May 2013) Log Message: ----------- less debug info Modified Paths: -------------- trunk/php/acl.pinc Modified: trunk/php/acl.pinc =================================================================== --- trunk/php/acl.pinc 2013-05-24 15:27:15 UTC (rev 1084) +++ trunk/php/acl.pinc 2013-05-27 15:15:27 UTC (rev 1085) @@ -184,8 +184,8 @@ if ( $id < 0 ) return; if (!$obj->acl_write) { - dterror_log('no need to save acl data for: '.$obj.' '.print_r($obj->acl,true)."\r\n",3,$tutos[errlog]); if (!isset($obj->acl) || !is_array($obj->acl)) { + dterror_log('no need to save acl data for: '.$obj.' '.print_r($obj->acl,true)."\r\n",3,$tutos[errlog]); dterror_log(TUTOS_backtrace()."\r\n",3,$tutos[errlog]); } return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-24 15:27:20
|
Revision: 1084 http://sourceforge.net/p/tutos/code/1084 Author: gokohnert Date: 2013-05-24 15:27:15 +0000 (Fri, 24 May 2013) Log Message: ----------- some fixes found in automated tests Modified Paths: -------------- trunk/php/app_overview.php trunk/php/config_default.pinc trunk/php/db/db.pinc trunk/php/file/file_overview.php trunk/php/product_role_ins.php trunk/php/scrum/log_new.php trunk/php/sms/sms_new.php trunk/php/subversion/svn_check.php trunk/php/timetrack/timetrack_ins.php trunk/test.sh Modified: trunk/php/app_overview.php =================================================================== --- trunk/php/app_overview.php 2013-05-24 09:15:10 UTC (rev 1083) +++ trunk/php/app_overview.php 2013-05-24 15:27:15 UTC (rev 1084) @@ -356,7 +356,6 @@ $this->nav['list'][] = $a->id; unset($a); } - $this->nav['list'] = $np; $res->free(); } else { // subsession found Modified: trunk/php/config_default.pinc =================================================================== --- trunk/php/config_default.pinc 2013-05-24 09:15:10 UTC (rev 1083) +++ trunk/php/config_default.pinc 2013-05-24 15:27:15 UTC (rev 1084) @@ -735,7 +735,7 @@ // // The TUTOS Version number // -$tutos[version] = '1.9.20130517'; +$tutos[version] = '1.9.20130524'; // ### Local Variables: *** ### mode:iso-accents *** Modified: trunk/php/db/db.pinc =================================================================== --- trunk/php/db/db.pinc 2013-05-24 09:15:10 UTC (rev 1083) +++ trunk/php/db/db.pinc 2013-05-24 15:27:15 UTC (rev 1084) @@ -748,7 +748,7 @@ $cnt = $rc->get(0, "c"); $rc->free(); if ($this->range_start == -1) { - $this->range_start = $cnt - $this->range_cnt; + $this->range_start = min(0,$cnt - $this->range_cnt); } } Modified: trunk/php/file/file_overview.php =================================================================== --- trunk/php/file/file_overview.php 2013-05-24 09:15:10 UTC (rev 1083) +++ trunk/php/file/file_overview.php 2013-05-24 15:27:15 UTC (rev 1084) @@ -298,8 +298,9 @@ if ( !isset($this->nav['list']) ) { $this->result = $this->dbconn->Exec($this->q); - $n = $this->result->numrows(); - $np = array(); + $n = $this->result->numrows(); + $np = array(); + $x = 0; while ( $x < $n ) { $f = new tutos_file($this->dbconn); $f->read_result($this->result,$x); Modified: trunk/php/product_role_ins.php =================================================================== --- trunk/php/product_role_ins.php 2013-05-24 09:15:10 UTC (rev 1083) +++ trunk/php/product_role_ins.php 2013-05-24 15:27:15 UTC (rev 1084) @@ -51,9 +51,10 @@ } // Add given People Role - -$nbadd = $_POST['nbadd']; - +$nbadd = 0; +if (isset($_POST['nbadd'])) { + $nbadd = $_POST['nbadd']; +} for($i=1; $i<=$nbadd; $i++) { $rid = 'r'.$i.'id'; $fn = 'r'.$i.'fn'; Modified: trunk/php/scrum/log_new.php =================================================================== --- trunk/php/scrum/log_new.php 2013-05-24 09:15:10 UTC (rev 1083) +++ trunk/php/scrum/log_new.php 2013-05-24 15:27:15 UTC (rev 1084) @@ -203,10 +203,10 @@ if ( $o->is_moveable() && ($o->w_id > 0) && ($o->start_dt->ts >= $this->sprint->start_dt->ts) ) { -# echo $o->start_dt->ts .'-'. $this->sprint->start_dt->ts .'<br>'; + # echo $o->start_dt->ts .'-'. $this->sprint->start_dt->ts .'<br>'; $day = $o->start_dt->ts - $this->sprint->start_dt->ts; $day = round($day / 86400); -# echo $day .'<br>'; + # echo $day .'<br>'; $this->xarr[$o->w_id][$day][$o->id] = &$o; } else { $this->xarr[-2][-1][$o->id] = &$o; @@ -905,6 +905,11 @@ if (isset($_GET['p_id'])) { $this->pref = getObject($this->dbconn,$_GET['p_id']); + if (!is_object($this->pref)) { + $msg = addLine($msg,sprintf($lang['Err0040'],$lang['ScrumLogPref'])); + $this->stop = true; + return; + } $this->obj->p_ref = $this->pref; $this->link1 = addUrlParameter($this->link1,"p_id=".$this->pref->id); } Modified: trunk/php/sms/sms_new.php =================================================================== --- trunk/php/sms/sms_new.php 2013-05-24 09:15:10 UTC (rev 1083) +++ trunk/php/sms/sms_new.php 2013-05-24 15:27:15 UTC (rev 1084) @@ -1,11 +1,13 @@ <?php /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2013 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; version 2 of the License. */ +$tutos['files'][__FILE__] = '$Rev$'; + $tutos['base'] = "../.."; ini_set("include_path",".."); require_once 'webelements.p3'; @@ -95,5 +97,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/subversion/svn_check.php =================================================================== --- trunk/php/subversion/svn_check.php 2013-05-24 09:15:10 UTC (rev 1083) +++ trunk/php/subversion/svn_check.php 2013-05-24 15:27:15 UTC (rev 1084) @@ -16,6 +16,7 @@ $tutos['base'] = "../.."; ini_set("include_path",".."); +$lang = array(); require_once 'webelements.p3'; require_once 'permission.p3'; require_once 'product.pinc'; Modified: trunk/php/timetrack/timetrack_ins.php =================================================================== --- trunk/php/timetrack/timetrack_ins.php 2013-05-24 09:15:10 UTC (rev 1083) +++ trunk/php/timetrack/timetrack_ins.php 2013-05-24 15:27:15 UTC (rev 1084) @@ -154,6 +154,7 @@ $tt->setVolume($volume); } } + // distance if ( isset($_POST['distance']) && $_POST['distance'] != "" ) { $distance = trim($_POST['distance']); @@ -167,7 +168,6 @@ } } - // volume todo if ( isset($_POST['volume_todo']) && $_POST['volume_todo'] != "" ) { $vt = trim($_POST['volume_todo']); Modified: trunk/test.sh =================================================================== --- trunk/test.sh 2013-05-24 09:15:10 UTC (rev 1083) +++ trunk/test.sh 2013-05-24 15:27:15 UTC (rev 1084) @@ -361,6 +361,7 @@ expense/expense_overview.php?link_id=$P_ID&lg=$LG fax/fax_new.php?a=$ADR&nr=123;&lg=$LG fax/fax_new.php?a=$NOID;&lg=$LG + fax/fax_ins.php?lg=$LG file/file_config.php?lg=$LG file/file_ins.php?lg=$LG file/file_del.php?lg=$LG @@ -524,6 +525,7 @@ scrum/sprint_overview.php?p_id=$P_ID&lg=$LG scrum/sprint_overview.php?w_id=$NOID&lg=$LG scrum/sprint_overview.php?w_id=$ADR&lg=$LG + sms/sms_new.php?v=001555&p=123;&lg=$LG stc/stc_ins.php?lg=$LG stc/stc_new.php?lg=$LG stc/stc_overview.php?lg=$LG This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-24 09:15:13
|
Revision: 1083 http://sourceforge.net/p/tutos/code/1083 Author: gokohnert Date: 2013-05-24 09:15:10 +0000 (Fri, 24 May 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/php/reminder/reminder.pinc Modified: trunk/php/reminder/reminder.pinc =================================================================== --- trunk/php/reminder/reminder.pinc 2013-05-24 09:13:12 UTC (rev 1082) +++ trunk/php/reminder/reminder.pinc 2013-05-24 09:15:10 UTC (rev 1083) @@ -534,7 +534,7 @@ } else { $this->id = $q->addFV('id',-1,'NEXTID'); // adopt the permissions from the referenced object - $this->copy_acl($this->ref->acl,true); + $this->copy_acl($this->ref,true); $this->acl_default(); // Prepare the history This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-24 09:13:15
|
Revision: 1082 http://sourceforge.net/p/tutos/code/1082 Author: gokohnert Date: 2013-05-24 09:13:12 +0000 (Fri, 24 May 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/php/acl.pinc Modified: trunk/php/acl.pinc =================================================================== --- trunk/php/acl.pinc 2013-05-24 09:05:29 UTC (rev 1081) +++ trunk/php/acl.pinc 2013-05-24 09:13:12 UTC (rev 1082) @@ -237,7 +237,7 @@ } } - $obj->cache_update('_acl'.$id,$this->acl,$tutos['timetolive']*60); + $obj->cache_update('_acl'.$id,$obj->acl,$tutos['timetolive']*60); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-24 09:05:32
|
Revision: 1081 http://sourceforge.net/p/tutos/code/1081 Author: gokohnert Date: 2013-05-24 09:05:29 +0000 (Fri, 24 May 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/php/webelements.p3 Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2013-05-24 08:37:48 UTC (rev 1080) +++ trunk/php/webelements.p3 2013-05-24 09:05:29 UTC (rev 1081) @@ -1856,7 +1856,7 @@ $g_hash['hits2']++; $type = $r->get(0,'tutostype'); if ($type != noobject) { - $r->cache_store('_TT'.$id,$type); + tutos_base::cache_store_static($memid,$type); } } $r->free(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-24 08:37:51
|
Revision: 1080 http://sourceforge.net/p/tutos/code/1080 Author: gokohnert Date: 2013-05-24 08:37:48 +0000 (Fri, 24 May 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/php/doctracker/doctracker.pinc trunk/php/expense/expense.pinc trunk/php/installation/installation.pinc trunk/php/mailbox/mailbox.pinc trunk/php/module_template/AAA.pinc trunk/php/subversion/svn.pinc Modified: trunk/php/doctracker/doctracker.pinc =================================================================== --- trunk/php/doctracker/doctracker.pinc 2013-05-24 08:35:32 UTC (rev 1079) +++ trunk/php/doctracker/doctracker.pinc 2013-05-24 08:37:48 UTC (rev 1080) @@ -163,7 +163,7 @@ } else { $this->id = $q->addFV("id",-1,"NEXTID"); // adopt the permissions from the referenced object - $this->acl_copy($this->ref,true); + $this->copy_acl($this->ref,true); $this->acl_default($this->creator); // Prepare the history @@ -681,7 +681,7 @@ } else { $this->id = $q->addFV("id",-1,"NEXTID"); // adopt the permissions from the referenced object - $this->acl_copy($this->ref,true); + $this->copy_acl($this->ref,true); $this->acl_default($this->creator); // Prepare the history @@ -879,4 +879,4 @@ } -?> \ No newline at end of file +?> Modified: trunk/php/expense/expense.pinc =================================================================== --- trunk/php/expense/expense.pinc 2013-05-24 08:35:32 UTC (rev 1079) +++ trunk/php/expense/expense.pinc 2013-05-24 08:37:48 UTC (rev 1080) @@ -709,7 +709,7 @@ } else { $this->id = $q->addFV('id',-1,'NEXTID'); // adopt the permissions from the referenced object - $this->acl_copy($this->ref,true); + $this->copy_acl($this->ref,true); $this->acl_default(); $this->acl_raise($this->getObjectGroupId(2),$tutos[useok]); $this->acl_raise($this->getObjectGroupId(3),$tutos[seeok]); @@ -1070,4 +1070,4 @@ return $r; } } -?> \ No newline at end of file +?> Modified: trunk/php/installation/installation.pinc =================================================================== --- trunk/php/installation/installation.pinc 2013-05-24 08:35:32 UTC (rev 1079) +++ trunk/php/installation/installation.pinc 2013-05-24 08:37:48 UTC (rev 1080) @@ -449,7 +449,7 @@ $this->id = $q->addFV('id',-1,'NEXTID'); // Defaut Access Control $this->acl_default($this,$current_user); - $this->acl_copy($this->product,true); + $this->copy_acl($this->product,true); $this->acl_raise($current_user->id,$tutos[delok]); // seller may mod @@ -827,4 +827,4 @@ return $r; } } -?> \ No newline at end of file +?> Modified: trunk/php/mailbox/mailbox.pinc =================================================================== --- trunk/php/mailbox/mailbox.pinc 2013-05-24 08:35:32 UTC (rev 1079) +++ trunk/php/mailbox/mailbox.pinc 2013-05-24 08:37:48 UTC (rev 1080) @@ -587,7 +587,7 @@ } else { $this->id = $q->addFV('id',-1,'NEXTID'); // Defaut Access Control - $this->acl_copy($this->parent,true); + $this->copy_acl($this->parent,true); $this->acl_default($current_user); $this->acl_raise($current_user->id,$tutos[delok]); @@ -802,4 +802,4 @@ return $r; } } -?> \ No newline at end of file +?> Modified: trunk/php/module_template/AAA.pinc =================================================================== --- trunk/php/module_template/AAA.pinc 2013-05-24 08:35:32 UTC (rev 1079) +++ trunk/php/module_template/AAA.pinc 2013-05-24 08:37:48 UTC (rev 1080) @@ -186,7 +186,7 @@ } else { $this->id = $q->addFV('id',-1,'NEXTID'); // adopt the permissions from the referenced object - # $this->acl_copy($this->ref,true); + # $this->copy_acl($this->ref,true); $this->acl_default(); // Prepare the history @@ -386,4 +386,4 @@ return $r; } } -?> \ No newline at end of file +?> Modified: trunk/php/subversion/svn.pinc =================================================================== --- trunk/php/subversion/svn.pinc 2013-05-24 08:35:32 UTC (rev 1079) +++ trunk/php/subversion/svn.pinc 2013-05-24 08:37:48 UTC (rev 1080) @@ -592,7 +592,7 @@ } else { $this->id = $q->addFV('id',-1,'NEXTID'); // adopt the permissions from the referenced object - $this->acl_copy($this->ref,true); + $this->copy_acl($this->ref,true); $this->acl_default(); // Prepare the history @@ -778,4 +778,4 @@ } } -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-24 08:35:37
|
Revision: 1079 http://sourceforge.net/p/tutos/code/1079 Author: gokohnert Date: 2013-05-24 08:35:32 +0000 (Fri, 24 May 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/php/location.pinc Modified: trunk/php/location.pinc =================================================================== --- trunk/php/location.pinc 2013-05-24 07:13:24 UTC (rev 1078) +++ trunk/php/location.pinc 2013-05-24 08:35:32 UTC (rev 1079) @@ -374,7 +374,7 @@ $this->id = $q1->addFV('id',-1,'NEXTID'); // Defaut Access Control inheritet from parent - $this->acl_copy($this->ref,true); + $this->copy_acl($this->ref,true); $this->acl_default(); $this->acl_raise(EVERYBODY, $tutos[useok]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-24 07:13:27
|
Revision: 1078 http://sourceforge.net/p/tutos/code/1078 Author: gokohnert Date: 2013-05-24 07:13:24 +0000 (Fri, 24 May 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/php/base.pinc Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2013-05-24 06:14:45 UTC (rev 1077) +++ trunk/php/base.pinc 2013-05-24 07:13:24 UTC (rev 1078) @@ -1889,7 +1889,7 @@ global $tutos; if($tutos['use_memcache']) { - return @$tutos['memcache']->get($memid,$value,0,$ttl); + return @$tutos['memcache']->get($memid); } else if ($tutos['use_apccache']) { return apc_fetch($memid); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-24 06:14:49
|
Revision: 1077 http://sourceforge.net/p/tutos/code/1077 Author: gokohnert Date: 2013-05-24 06:14:45 +0000 (Fri, 24 May 2013) Log Message: ----------- add fileinfo Modified Paths: -------------- trunk/php/pdf.pinc Modified: trunk/php/pdf.pinc =================================================================== --- trunk/php/pdf.pinc 2013-05-24 06:13:32 UTC (rev 1076) +++ trunk/php/pdf.pinc 2013-05-24 06:14:45 UTC (rev 1077) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2004 - 2010 by Gero Kohnert + * Copyright 2004 - 2013 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -11,6 +11,7 @@ * SVN Info $Id$ * $Author$ */ +$tutos['files'][__FILE__] = '$Rev$'; if ($tutos[fpdfpath] != "") { if (!file_exists($tutos['base'] ."/". $tutos[fpdfpath].'/fpdf.php')) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-24 06:13:34
|
Revision: 1076 http://sourceforge.net/p/tutos/code/1076 Author: gokohnert Date: 2013-05-24 06:13:32 +0000 (Fri, 24 May 2013) Log Message: ----------- info Modified Paths: -------------- trunk/php/testmanager/testrun_ins.php Modified: trunk/php/testmanager/testrun_ins.php =================================================================== --- trunk/php/testmanager/testrun_ins.php 2013-05-24 06:12:56 UTC (rev 1075) +++ trunk/php/testmanager/testrun_ins.php 2013-05-24 06:13:32 UTC (rev 1076) @@ -25,7 +25,8 @@ loadmodules('testrun','ins'); loadmodule('testrun'); -$msg = ''; +$msg = ''; +$info = ''; $gotourl = 'testmanager/testrun_new.php'; if (isset($_REQUEST['ss'])) { $gotourl= addUrlParameter($gotourl,'ss='. $_REQUEST['ss'],true); @@ -52,9 +53,9 @@ $obj->read_reference(); $dbconn->Begin("WORK"); - $msg = addLine($msg,$obj->parse_input($obj->run,$obj)); + $info = addLine($info,$obj->parse_input($obj->run,$obj)); $dbconn->Commit("WORK"); - leave_insert($dbconn,'../'.$gotourl,$msg); + leave_insert($dbconn,'../'.$gotourl,$msg,$info); exit; } @@ -134,7 +135,7 @@ if (isset($_REQUEST['ss'])) { $gotourl= addUrlParameter($gotourl,'ss='. $_REQUEST['ss'],true); } -leave_insert($dbconn,'../'.$gotourl,$msg); +leave_insert($dbconn,'../'.$gotourl,$msg,$info); /** * SVN Info $Id$ * $Author$ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-24 06:13:01
|
Revision: 1075 http://sourceforge.net/p/tutos/code/1075 Author: gokohnert Date: 2013-05-24 06:12:56 +0000 (Fri, 24 May 2013) Log Message: ----------- encapsulate caching Modified Paths: -------------- trunk/php/acl.pinc trunk/php/base.pinc trunk/php/webelements.p3 Modified: trunk/php/acl.pinc =================================================================== --- trunk/php/acl.pinc 2013-05-23 12:36:57 UTC (rev 1074) +++ trunk/php/acl.pinc 2013-05-24 06:12:56 UTC (rev 1075) @@ -99,20 +99,11 @@ } // Try to get it from memcache - if($tutos['use_memcache']) { - $memid = $obj->dbconn->db->systemid.'_acl'.$id; - $obj->acl = @$tutos['memcache']->get($memid); - if ($obj->acl !== false) { - $g_hash['hits3']++; - return; - } - } else if ($tutos['use_apccache']) { - $memid = $obj->dbconn->db->systemid.'_acl'.$id; - $obj->acl = apc_fetch($memid); - if ($obj->acl !== false) { - $g_hash['hits3']++; - return; - } + $fail = true; + $obj->acl = $obj->cache_get('_acl'.$id); + if ($obj->acl !== false) { + $g_hash['hits3']++; + return; } $q = 'SELECT '. $obj->dbconn->colname('adr_id') .','. $obj->dbconn->colname('perm') .' FROM '. $obj->dbconn->prefix.$table['acl'][name].' WHERE '. $obj->dbconn->colname('obj_id') .' = '; @@ -173,12 +164,8 @@ $res->free(); - if($tutos['use_memcache']) { - $tutos['memcache']->set($memid,$obj->acl,0,$tutos['timetolive']*60); + if($obj->cache_store('_acl'.$id,$obj->acl,$tutos['timetolive']*60)) { $g_hash['fail3']++; - } else if ($tutos['use_apccache']) { - $obj->acl = apc_store($memid,$obj->acl,$tutos['timetolive']*60); - $g_hash['fail3']++; } return; } @@ -198,6 +185,9 @@ if (!$obj->acl_write) { dterror_log('no need to save acl data for: '.$obj.' '.print_r($obj->acl,true)."\r\n",3,$tutos[errlog]); + if (!isset($obj->acl) || !is_array($obj->acl)) { + dterror_log(TUTOS_backtrace()."\r\n",3,$tutos[errlog]); + } return; } else { // dterror_log('save acl data for: '.$obj."\r\n",3,$tutos[errlog]); @@ -246,13 +236,8 @@ } } } - if($tutos['use_memcache']) { - $memid = $obj->dbconn->db->systemid.'_acl'.$id; - $tutos['memcache']->replace($memid,$obj->acl,0,$tutos['timetolive']*60); - } else if ($tutos['use_apccache']) { - $memid = $obj->dbconn->db->systemid.'_acl'.$id; - apc_store($memid,$obj->acl,$tutos['timetolive']*60); - } + + $obj->cache_update('_acl'.$id,$this->acl,$tutos['timetolive']*60); } /** @@ -277,13 +262,7 @@ $res = $obj->dbconn->Exec($q); $res->free(); - if($tutos['use_memcache']) { - $memid = $obj->dbconn->db->systemid.'_acl'.$obj->id; - $tutos['memcache']->delete($memid,0); - } else if ($tutos['use_apccache']) { - $memid = $obj->dbconn->db->systemid.'_acl'.$obj->id; - apc_delete($memid); - } + $obj->cache_del('_acl'.$obj->id); return $msg; } Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2013-05-23 12:36:57 UTC (rev 1074) +++ trunk/php/base.pinc 2013-05-24 06:12:56 UTC (rev 1075) @@ -211,22 +211,11 @@ } $r = false; - if($tutos['use_memcache']) { - $memid = $obj->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$id; - $x = $tutos['memcache']->get($memid); - if ($x !== false && count($x)) { - $r = new result_mem($obj->dbconn); - $r->putall($x); - $g_hash['hits3']++; - } - } else if ($tutos['use_apccache']) { - $memid = $obj->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$id; - $x = apc_fetch($memid); - if ($x !== false && count($x)) { - $r = new result_mem($obj->dbconn); - $r->putall($x); - $g_hash['hits3']++; - } + $x = $obj->cache_get('_'.$this->gettypeid().'_'.$id); + if ($x !== false && count($x)) { + $r = new result_mem($obj->dbconn); + $r->putall($x); + $g_hash['hits3']++; } if ($r == false) { @@ -245,12 +234,8 @@ $r->free(); return -1; } - if($tutos['use_memcache']) { - $tutos['memcache']->set($memid,$r->getall(0),0,$tutos['timetolive']*60); + if($obj->cache_store('_'.$this->gettypeid().'_'.$id,$r->getall(0))) { $g_hash['fail3']++; - } else if ($tutos['use_apccache']) { - apc_store($memid,$r->getall(0),$tutos['timetolive']*60); - $g_hash['fail3']++; } } $obj->read_result($r,0); @@ -313,21 +298,11 @@ // TODO: save description // read relations - $memid1 = $this->dbconn->db->systemid.'_r'.$this->id; - $memid2 = $this->dbconn->db->systemid.'_br'.$this->id; $fail = false; - if($tutos['use_memcache']) { - $this->relations = @$tutos['memcache']->get($memid1); - $this->back_relations = @$tutos['memcache']->get($memid2); - if (!is_array($this->relations) || !is_array($this->back_relations)) { - $fail = true; - } - } else if ($tutos['use_apccache']) { - $this->relations = apc_fetch($memid1); - $this->back_relations = apc_fetch($memid2); - if (!is_array($this->relations) || !is_array($this->back_relations)) { - $fail = true; - } + $this->relations = $this->cache_get('_r'.$this->id); + $this->back_relations = $this->cache_get('_br'.$this->id); + if (!is_array($this->relations) || !is_array($this->back_relations)) { + $fail = true; } if (!$fail) { @@ -356,13 +331,8 @@ $rr->free(); // cache it // update cache - if($tutos['use_memcache']) { - $tutos['memcache']->set($memid1,$this->relations,0,$tutos['timetolive']*360); - $tutos['memcache']->set($memid2,$this->back_relations,0,$tutos['timetolive']*360); - } else if ($tutos['use_apccache']) { - apc_store($memid1,$this->relations,$tutos['timetolive']*360); - apc_store($memid2,$this->back_relations,$tutos['timetolive']*360); - } + $this->cache_store('_r'.$this->id,$this->relations); + $this->cache_store('_br'.$this->id,$this->back_relations); } $g_hash[$this->id] = &$this; @@ -1400,17 +1370,7 @@ $msg = addLine($msg,$this->save_obj_id()); $g_hash[$this->id] = &$this; } - if($tutos['use_memcache']) { - $memid = $this->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$this->id; - $memid1 = $this->dbconn->db->systemid.'_r'.$this->id; - $memid2 = $this->dbconn->db->systemid.'_br'.$this->id; - $tutos['memcache']->delete($memid,0); - } else if ($tutos['use_apccache']) { - $memid = $this->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$this->id; - $memid1 = $this->dbconn->db->systemid.'_r'.$this->id; - $memid2 = $this->dbconn->db->systemid.'_br'.$this->id; - apc_delete($memid); - } + $this->cache_del('_'.$this->gettypeid().'_'.$this->id); foreach ($tutos[activemodules] as $f) { $x = new $tutos[modules][$f][name]($this->dbconn); @@ -1452,14 +1412,8 @@ } } if ($cnt + $cnt2 > 0) { - // update cache - if($tutos['use_memcache']) { - $tutos['memcache']->set($memid1,$this->relations,0,$tutos['timetolive']*360); - $tutos['memcache']->set($memid2,$this->back_relations,0,$tutos['timetolive']*360); - } else if ($tutos['use_apccache']) { - apc_store($memid1,$this->relations,$tutos['timetolive']*360); - apc_store($memid2,$this->back_relations,$tutos['timetolive']*360); - } + $this->cache_store('_r'.$this->id,$this->relations); + $this->cache_store('_br'.$this->id,$this->back_relations); } $msg = addLine($msg,$this->run_postsave_hook()); return $msg; @@ -1488,13 +1442,7 @@ $r->free(); // save for future use - if($tutos['use_memcache']) { - $memid = $this->dbconn->db->systemid.'_TT'.$x; - $tutos['memcache']->set($memid,$this->getTypeId(),0,$tutos['timetolive']*360); - } else if ($tutos['use_apccache']) { - $memid = $this->dbconn->db->systemid.'_TT'.$x; - apc_store($memid,$this->getTypeId(),$tutos['timetolive']*360); - } + $this->cache_store('_TT'.$x,$this->getTypeId()); return $msg; } @@ -1511,13 +1459,7 @@ $q = 'DELETE FROM '. $this->dbconn->prefix.$this->tablename_rel .' where obj_id = '. $this->id.' or rel_id = '.$this->id; $r = $this->dbconn->Exec($q); $r->free(); - if($tutos['use_memcache']) { - $memid = $this->dbconn->db->systemid.'_TT'.$this->id; - $tutos['memcache']->delete($memid,0); - } else if ($tutos['use_apccache']) { - $memid = $this->dbconn->db->systemid.'_TT'.$this->id; - apc_delete($memid); - } + $this->cache_del('_TT'.$this->id); return $msg; } @@ -1554,13 +1496,7 @@ if (isset( $_SESSION['history'][$this->id] ) ) { unset( $_SESSION['history'][$this->id] ); } - if($tutos['use_memcache']) { - $memid = $this->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$this->id; - $tutos['memcache']->delete($memid,0); - } else if ($tutos['use_apccache']) { - $memid = $this->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$this->id; - apc_delete($memid); - } + $this->cache_del('_'.$this->gettypeid().'_'.$this->id); $msg = addLine($msg,$this->run_postdel_hook()); return $msg; } @@ -1945,5 +1881,95 @@ if ($x == $y) return 0; return ($x < $y) ? -1 : 1; } + + /** + * cache get (static) + */ + static function cache_get_static($memid) { + global $tutos; + + if($tutos['use_memcache']) { + return @$tutos['memcache']->get($memid,$value,0,$ttl); + } else if ($tutos['use_apccache']) { + return apc_fetch($memid); + } + return false; + } + + /** + * get from cache + */ + function cache_get($id) { + return $this->cache_get_static($this->dbconn->db->systemid.$id); + } + + /** + * delete from cache + */ + function cache_del($id) { + global $tutos; + + $memid = $this->dbconn->db->systemid.$id; + + if($tutos['use_memcache']) { + return @$tutos['memcache']->delete($memid,0); + } else if ($tutos['use_apccache']) { + return apc_delete($memid); + } + return false; + } + + /** + * update in cache + * ttl == -1 -> default + * return true if cached false id no cache works + */ + function cache_update($id,$value,$ttl = -1) { + global $tutos; + + if ($ttl == -1) { + $ttl = $tutos['timetolive']*360; + } + $memid = $this->dbconn->db->systemid.$id; + + if($tutos['use_memcache']) { + $tutos['memcache']->replace($memid,$value,0,$ttl); + return true; + } else if ($tutos['use_apccache']) { + $obj->acl = apc_store($memid,$value,$ttl); + return true; + } + return false; + } + + /** + * store in cache (static) + * ttl == -1 -> default + * return true if cached false id no cache works + */ + static function cache_store_static($memid,$value,$ttl = -1) { + global $tutos; + + if ($ttl == -1) { + $ttl = $tutos['timetolive']*360; + } + if($tutos['use_memcache']) { + $tutos['memcache']->set($memid,$value,0,$ttl); + return true; + } else if ($tutos['use_apccache']) { + $obj->acl = apc_store($memid,$value,$ttl); + return true; + } + return false; + } + + /** + * store in cache (static) + * ttl == -1 -> default + * return true if cached false id no cache works + */ + function cache_store($id,$value,$ttl = -1) { + return $this->cache_store_static($this->dbconn->db->systemid.$id,$value,$ttl); + } } ?> \ No newline at end of file Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2013-05-23 12:36:57 UTC (rev 1074) +++ trunk/php/webelements.p3 2013-05-24 06:12:56 UTC (rev 1075) @@ -1831,27 +1831,16 @@ $memid = $dbconn->db->systemid.'_TT'.$id; // Second use the type info from objectids table - if($tutos['use_memcache']) { - $x = $tutos['memcache']->get($memid); - if ($x !== false ) { - $found = true; - $found_by_hash = true; - $g_hash['hits4']++; - $type = $x; - } else { - $g_hash['fail4']++; - } - } else if ($tutos['use_apccache']) { - $x = apc_fetch($memid); - if ($x !== false ) { - $found = true; - $found_by_hash = true; - $g_hash['hits4']++; - $type = $x; - } else { - $g_hash['fail4']++; - } + $x = tutos_base::cache_get_static($memid); + if ($x !== false ) { + $found = true; + $found_by_hash = true; + $g_hash['hits4']++; + $type = $x; + } else { + $g_hash['fail4']++; } + if (!$found) { if ($dbconn->prep) { $dbconn->addPStatement('select tutostype from '. $dbconn->prefix . $dbconn->db->tablename_hash .' where id = $1','HASH'); @@ -1866,10 +1855,8 @@ $found_by_hash = true; $g_hash['hits2']++; $type = $r->get(0,'tutostype'); - if($tutos['use_memcache'] && $type != noobject ) { - $tutos['memcache']->set($memid,$type,0,$tutos['timetolive']*360); - } else if ($tutos['use_apccache'] && $type != noobject) { - apc_store($memid,$type,$tutos['timetolive']*360); + if ($type != noobject) { + $r->cache_store('_TT'.$id,$type); } } $r->free(); @@ -1882,11 +1869,7 @@ // save for future use if (!$found_by_hash) { - if($tutos['use_memcache'] && $type != noobject ) { - $tutos['memcache']->set($memid,$type,0,$tutos['timetolive']*360); - } else if ($tutos['use_apccache'] && $type != noobject) { - apc_store($memid,$type,$tutos['timetolive']*360); - } + tutos_base::cache_store_static($memid,$type); } switch ($type) { @@ -1997,11 +1980,7 @@ $g_hash[$id] = -1; $g_hash['fail2']++; // save for future use that this is meanwhile deleted - if($tutos['use_memcache']) { - $tutos['memcache']->set($memid,0,0,$tutos['timetolive']*360); - } else if ($tutos['use_apccache']) { - apc_store($memid,0,$tutos['timetolive']*360); - } + tutos_base::cache_store_static($memid,0); //error_log('getObject failed for '.$id .' '.TUTOS_backtrace()."\n",3,$tutos[errlog]); } if (is_object($current_user) && ($current_user->id != $save_cu)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-23 12:37:02
|
Revision: 1074 http://sourceforge.net/p/tutos/code/1074 Author: gokohnert Date: 2013-05-23 12:36:57 +0000 (Thu, 23 May 2013) Log Message: ----------- save roles at once Modified Paths: -------------- trunk/php/product.pinc Modified: trunk/php/product.pinc =================================================================== --- trunk/php/product.pinc 2013-05-23 12:27:47 UTC (rev 1073) +++ trunk/php/product.pinc 2013-05-23 12:36:57 UTC (rev 1074) @@ -569,13 +569,14 @@ $q = 'DELETE FROM '. $this->tablename2 .' WHERE pro_id = '. $this->id; $r = $this->dbconn->Exec($q); $r->free(); + $q = 'INSERT INTO '. $this->tablename2 .' (pro_id,adr_id,role_id,description) VALUES '; + $pre = ''; foreach ($lang['ProdRole'] as $role => $f) { if ( isset ($this->role[$role] ) && is_array ($this->role[$role]) ) { foreach ($this->role[$role] as $i => $o) { if ( is_object($o) ) { - $q = 'INSERT INTO '. $this->tablename2 .' (pro_id,adr_id,role_id,description) VALUES ('. $this->id .','. $i .','. $role .','. $this->dbconn->String($this->roledesc[$role][$o->id]).')'; - $r = $this->dbconn->Exec($q); - $r->free(); + $q .= $pre .'('. $this->id .','.$i.','.$role.','.$this->dbconn->String($this->roledesc[$role][$o->id]).')'; + $pre = ','; if ( ($o->getType() == "address") || ($o->getType() == "team") ) { $this->acl_raise($o->id,$tutos[modok]); } @@ -583,9 +584,12 @@ } } } + if ($pre != '') { + $r = $this->dbconn->Exec($q); + $r->free(); + } } - /** * read the classification of this project */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-23 12:27:52
|
Revision: 1073 http://sourceforge.net/p/tutos/code/1073 Author: gokohnert Date: 2013-05-23 12:27:47 +0000 (Thu, 23 May 2013) Log Message: ----------- insert history at once Modified Paths: -------------- trunk/php/history.pinc Modified: trunk/php/history.pinc =================================================================== --- trunk/php/history.pinc 2013-05-23 11:45:59 UTC (rev 1072) +++ trunk/php/history.pinc 2013-05-23 12:27:47 UTC (rev 1073) @@ -74,21 +74,20 @@ if ( $start == -2 ) { $end = $n; - } else - if ( $start == -1 ) { - $a = $n - $tutos['maxshow']; - $end = $n; - $start = $a; - } else { - $a = $start; - $end = $start + $tutos['maxshow']; - } + } else if ( $start == -1 ) { + $a = $n - $tutos['maxshow']; + $end = $n; + $start = $a; + } else { + $a = $start; + $end = $start + $tutos['maxshow']; + } while ( ($a < $n) && ($a < $end) ) { $obj->history[$a] = array ( "field" => $r->get($a, "m_field") , "old" => $r->get($a, "val_old") , "new" => $r->get($a, "val_new"), - "adr_id" => $r->get($a, "adr_id"), - "obj_id" => $r->get($a, "obj_id"), + "adr_id" => $r->getInt($a, "adr_id"), + "obj_id" => $r->getInt($a, "obj_id"), "m_time" => $r->get($a, "m_time") ); $a++; @@ -96,6 +95,7 @@ $r->free(); return; } + /** * Save the history */ @@ -107,42 +107,45 @@ return; } - $t = new TUTOS_Date_Time(); + $t = new TUTOS_Date_Time(); + $q = 'INSERT into '. $obj->dbconn->prefix .$table['history'][name].' (obj_id,adr_id,m_field,m_time,val_old,val_new) VALUES '; + $pre = ''; foreach ($obj->modified as $i => $f) { if (!isset($f["field"]) || empty($f["field"]) ) { continue; } - $flds = "(obj_id,adr_id,m_field,m_time,val_old,val_new)"; - $vals = " VALUES "; + $q .= $pre.'('; if ( isset($f["obj_id"]) ) { - $vals .= "(" . $f["obj_id"]; + $q .= $f["obj_id"]; } else { - $vals .= "(" . $obj->id; + $q .= $obj->id; } if ( isset($f["adr_id"]) ) { - $vals .= "," . $f["adr_id"]; + $q .= ',' . $f["adr_id"]; } else { - $vals .= "," . $current_user->id; + $q .= ',' . $current_user->id; } + $q .= ',' . substr($obj->dbconn->String($f["field"]),0,$table['history']['m_field'][size]); + $q .= ',' . $obj->dbconn->DateTime($t); - $vals .= ',' . substr($obj->dbconn->String($f["field"]),0,$table['history']['m_field'][size]); - $vals .= ',' . $obj->dbconn->DateTime($t); // Field cutting patched from Brian Danilko <Brian.Danilko at instech.com.au> $maxlength = $table['history']['val_old'][size]; if ( mb_strlen($f["old"]) > $maxlength) { - $vals .= ',' . $obj->dbconn->String(mb_substr($f["old"],0,$maxlength-5) .'...'. mb_substr($f["old"],-2)); + $q .= ',' . $obj->dbconn->String(mb_substr($f["old"],0,$maxlength-5) .'...'. mb_substr($f["old"],-2)); } else { - $vals .= ',' . $obj->dbconn->String($f["old"]); + $q .= ',' . $obj->dbconn->String($f["old"]); } $maxlength = $table['history']['val_new'][size]; if ( mb_strlen($f["new"]) > $maxlength ) { - $vals .= ',' . $obj->dbconn->String(mb_substr($f["new"],0,$maxlength-5) .'...'. mb_substr($f["new"],-2)); + $q .= ',' . $obj->dbconn->String(mb_substr($f["new"],0,$maxlength-5) .'...'. mb_substr($f["new"],-2)); } else { - $vals .= ',' . $obj->dbconn->String($f["new"]); + $q .= ',' . $obj->dbconn->String($f["new"]); } - $vals .= ")"; - $q = 'INSERT into '. $obj->dbconn->prefix .$table['history'][name].' '. $flds . $vals; + $q .= ')'; + $pre = ','; + } + if ($pre != '') { $r = $obj->dbconn->Exec($q); $r->free(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-23 11:46:02
|
Revision: 1072 http://sourceforge.net/p/tutos/code/1072 Author: gokohnert Date: 2013-05-23 11:45:59 +0000 (Thu, 23 May 2013) Log Message: ----------- less role reading Modified Paths: -------------- trunk/php/product.pinc Modified: trunk/php/product.pinc =================================================================== --- trunk/php/product.pinc 2013-05-23 11:28:48 UTC (rev 1071) +++ trunk/php/product.pinc 2013-05-23 11:45:59 UTC (rev 1072) @@ -385,7 +385,7 @@ $this->brole[$i] = array(); $this->broledesc[$i] = array(); } - $this->readroles = false; + $this->readroles = false; // not yet read $this->classes = 2; for ( $cl = 1;$cl <= $this->classes; $cl++) { @@ -507,6 +507,8 @@ * read the different roles in this project */ function readroles () { + if ($this->readroles) return; + $q = 'SELECT * FROM '. $this->tablename2 .' WHERE pro_id = '. $this->id; $r = $this->dbconn->Exec($q); $n = $r->numrows(); @@ -1198,7 +1200,7 @@ $this->role[$role][$obj->id] = $obj; $this->roledesc[$role][$obj->id] = $desc; - $this->readroles = true; + $this->readroles = true; // a explicit read not longer neccessary return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-23 11:28:52
|
Revision: 1071 http://sourceforge.net/p/tutos/code/1071 Author: gokohnert Date: 2013-05-23 11:28:48 +0000 (Thu, 23 May 2013) Log Message: ----------- caching for relations Modified Paths: -------------- trunk/php/base.pinc trunk/php/team.pinc trunk/php/team_ins.php trunk/php/webelements.p3 Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2013-05-23 08:03:20 UTC (rev 1070) +++ trunk/php/base.pinc 2013-05-23 11:28:48 UTC (rev 1071) @@ -296,7 +296,7 @@ * read a resultset */ function read_result (result $r, $pos ) { - global $g_hash,$table; + global $tutos,$g_hash,$table; $this->id = $r->getInt($pos, 'id'); $this->creation = $r->getDateTime($pos, 'creation'); @@ -313,28 +313,57 @@ // TODO: save description // read relations - if ($this->dbconn->prep) { - $this->dbconn->addPStatement('SELECT * from '.$this->dbconn->prefix.$this->tablename_rel.' WHERE obj_id = $1 or rel_id = $2','BASEREL'); - $rr = $this->dbconn->execPStatement('BASEREL',1,$this->id,$this->id); - } else { - $q = 'SELECT * from '.$this->dbconn->prefix.$this->tablename_rel.' WHERE obj_id = '.$this->id.' or rel_id = '.$this->id; - $rr = $this->dbconn->Exec($q); + $memid1 = $this->dbconn->db->systemid.'_r'.$this->id; + $memid2 = $this->dbconn->db->systemid.'_br'.$this->id; + $fail = false; + if($tutos['use_memcache']) { + $this->relations = @$tutos['memcache']->get($memid1); + $this->back_relations = @$tutos['memcache']->get($memid2); + if (!is_array($this->relations) || !is_array($this->back_relations)) { + $fail = true; + } + } else if ($tutos['use_apccache']) { + $this->relations = apc_fetch($memid1); + $this->back_relations = apc_fetch($memid2); + if (!is_array($this->relations) || !is_array($this->back_relations)) { + $fail = true; + } } - $n = $rr->numrows(); - $a = 0; - while ($a < $n) { - $o = $rr->getInt($a,'obj_id'); - $b = $rr->getInt($a,'rel_id'); - if ($o == $this->id) { - $this->relations[$rr->getInt($a,'type_id')][$b] = 1; + + if (!$fail) { + $this->relations = apc_fetch($memid1); + $this->back_relations = apc_fetch($memid2); + if ($this->dbconn->prep) { + $this->dbconn->addPStatement('SELECT * from '.$this->dbconn->prefix.$this->tablename_rel.' WHERE obj_id = $1 or rel_id = $2','BASEREL'); + $rr = $this->dbconn->execPStatement('BASEREL',1,$this->id,$this->id); + } else { + $q = 'SELECT * from '.$this->dbconn->prefix.$this->tablename_rel.' WHERE obj_id = '.$this->id.' or rel_id = '.$this->id; + $rr = $this->dbconn->Exec($q); } - if ($b == $this->id) { - $this->back_relations[$rr->getInt($a,'type_id')][$o] = 1; + $n = $rr->numrows(); + $a = 0; + while ($a < $n) { + $o = $rr->getInt($a,'obj_id'); + $b = $rr->getInt($a,'rel_id'); + if ($o == $this->id) { + $this->relations[$rr->getInt($a,'type_id')][$b] = 1; + } + if ($b == $this->id) { + $this->back_relations[$rr->getInt($a,'type_id')][$o] = 1; + } + $a++; } - $a++; + $rr->free(); + // cache it + // update cache + if($tutos['use_memcache']) { + $tutos['memcache']->set($memid1,$this->relations,0,$tutos['timetolive']*360); + $tutos['memcache']->set($memid2,$this->back_relations,0,$tutos['timetolive']*360); + } else if ($tutos['use_apccache']) { + apc_store($memid1,$this->relations,$tutos['timetolive']*360); + apc_store($memid2,$this->back_relations,$tutos['timetolive']*360); + } } - $rr->free(); - $g_hash[$this->id] = &$this; $this->run_after_read_hook(); @@ -1372,10 +1401,14 @@ $g_hash[$this->id] = &$this; } if($tutos['use_memcache']) { - $memid = $this->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$this->id; + $memid = $this->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$this->id; + $memid1 = $this->dbconn->db->systemid.'_r'.$this->id; + $memid2 = $this->dbconn->db->systemid.'_br'.$this->id; $tutos['memcache']->delete($memid,0); } else if ($tutos['use_apccache']) { - $memid = $this->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$this->id; + $memid = $this->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$this->id; + $memid1 = $this->dbconn->db->systemid.'_r'.$this->id; + $memid2 = $this->dbconn->db->systemid.'_br'.$this->id; apc_delete($memid); } @@ -1407,6 +1440,7 @@ $r->free(); } // add new stuff + $cnt2 = 0; foreach ($this->addrel as $t => $rarr) { foreach ($rarr as $r => $x) { $q = 'INSERT into '.$this->dbconn->prefix.$this->tablename_rel.' (obj_id,rel_id,type_id,description) VALUES('; @@ -1414,9 +1448,19 @@ $q .= ')'; $r = $this->dbconn->Exec($q); $r->free(); + $cnt2++; } } - + if ($cnt + $cnt2 > 0) { + // update cache + if($tutos['use_memcache']) { + $tutos['memcache']->set($memid1,$this->relations,0,$tutos['timetolive']*360); + $tutos['memcache']->set($memid2,$this->back_relations,0,$tutos['timetolive']*360); + } else if ($tutos['use_apccache']) { + apc_store($memid1,$this->relations,$tutos['timetolive']*360); + apc_store($memid2,$this->back_relations,$tutos['timetolive']*360); + } + } $msg = addLine($msg,$this->run_postsave_hook()); return $msg; } Modified: trunk/php/team.pinc =================================================================== --- trunk/php/team.pinc 2013-05-23 08:03:20 UTC (rev 1070) +++ trunk/php/team.pinc 2013-05-23 11:28:48 UTC (rev 1071) @@ -646,7 +646,7 @@ /** * read teams via int id */ - function obj_read_int(&$obj,$id,$level = 0) { + function obj_read_int(tutos_base $obj,$id,$level = 0) { global $table; if ($obj->dbconn->prep) { @@ -659,7 +659,7 @@ $n = $r->numrows(); $a = 0; while ( $a < $n ) { - $tid = $r->get($a, 'id'); + $tid = $r->getInt($a, 'id'); if (!isset($obj->teamlist[$tid])) { $obj->teamlist[$tid] = $r->get($a, 'name'); team::obj_read_int($obj,$tid,($level +1)); @@ -688,6 +688,7 @@ $obj->teamlist = array(); $obj->teamlist_hide = array(); team::obj_read_int($obj,$obj->id); + asort($obj->teamlist); } /** Modified: trunk/php/team_ins.php =================================================================== --- trunk/php/team_ins.php 2013-05-23 08:03:20 UTC (rev 1070) +++ trunk/php/team_ins.php 2013-05-23 11:28:48 UTC (rev 1071) @@ -10,6 +10,8 @@ * @module team_ins * @package team */ +$tutos['files'][__FILE__] = '$Rev$'; + require_once 'webelements.p3'; require_once 'permission.p3'; @@ -17,7 +19,7 @@ check_user(); loadmodules('team','ins'); -$msg = ''; +$msg = ''; $gotourl = 'team_new.php'; $t = new team($dbconn); @@ -56,7 +58,7 @@ } if ( ! isset($_POST['owner']) ) { - $msg = addLine($msg,sprintf($lang['Err0009'],$lang['TeamManager'])); + //$msg = addLine($msg,sprintf($lang['Err0009'],$lang['TeamManager'])); } else { $owner = $_POST['owner']; $gotourl= addUrlParameter($gotourl,"owner=".$owner,true); Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2013-05-23 08:03:20 UTC (rev 1070) +++ trunk/php/webelements.p3 2013-05-23 11:28:48 UTC (rev 1071) @@ -1826,12 +1826,12 @@ } } - $found = false; + $found = false; $found_by_hash = false; + $memid = $dbconn->db->systemid.'_TT'.$id; // Second use the type info from objectids table if($tutos['use_memcache']) { - $memid = $dbconn->db->systemid.'_TT'.$id; $x = $tutos['memcache']->get($memid); if ($x !== false ) { $found = true; @@ -1842,7 +1842,6 @@ $g_hash['fail4']++; } } else if ($tutos['use_apccache']) { - $memid = $dbconn->db->systemid.'_TT'.$id; $x = apc_fetch($memid); if ($x !== false ) { $found = true; @@ -1867,6 +1866,11 @@ $found_by_hash = true; $g_hash['hits2']++; $type = $r->get(0,'tutostype'); + if($tutos['use_memcache'] && $type != noobject ) { + $tutos['memcache']->set($memid,$type,0,$tutos['timetolive']*360); + } else if ($tutos['use_apccache'] && $type != noobject) { + apc_store($memid,$type,$tutos['timetolive']*360); + } } $r->free(); } @@ -1879,10 +1883,8 @@ // save for future use if (!$found_by_hash) { if($tutos['use_memcache'] && $type != noobject ) { - $memid = $dbconn->db->systemid.'_TT'.$id; $tutos['memcache']->set($memid,$type,0,$tutos['timetolive']*360); } else if ($tutos['use_apccache'] && $type != noobject) { - $memid = $dbconn->db->systemid.'_TT'.$id; apc_store($memid,$type,$tutos['timetolive']*360); } } @@ -1996,10 +1998,8 @@ $g_hash['fail2']++; // save for future use that this is meanwhile deleted if($tutos['use_memcache']) { - $memid = $dbconn->db->systemid.'_TT'.$id; $tutos['memcache']->set($memid,0,0,$tutos['timetolive']*360); } else if ($tutos['use_apccache']) { - $memid = $dbconn->db->systemid.'_TT'.$id; apc_store($memid,0,$tutos['timetolive']*360); } //error_log('getObject failed for '.$id .' '.TUTOS_backtrace()."\n",3,$tutos[errlog]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-23 08:03:23
|
Revision: 1070 http://sourceforge.net/p/tutos/code/1070 Author: gokohnert Date: 2013-05-23 08:03:20 +0000 (Thu, 23 May 2013) Log Message: ----------- sort participant lists of appointments Modified Paths: -------------- trunk/php/appointment.pinc Modified: trunk/php/appointment.pinc =================================================================== --- trunk/php/appointment.pinc 2013-05-23 07:26:14 UTC (rev 1069) +++ trunk/php/appointment.pinc 2013-05-23 08:03:20 UTC (rev 1070) @@ -509,6 +509,7 @@ unset($p); } $result->free(); + uasort($this->participant,array('tutos_base','obj_sort')); $this->participants_is_read = true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-23 07:26:21
|
Revision: 1069 http://sourceforge.net/p/tutos/code/1069 Author: gokohnert Date: 2013-05-23 07:26:14 +0000 (Thu, 23 May 2013) Log Message: ----------- look at sortable and overview fglags for xutom fields in product overview Modified Paths: -------------- trunk/php/db/table_custom_example.pinc trunk/php/product_overview.php Modified: trunk/php/db/table_custom_example.pinc =================================================================== --- trunk/php/db/table_custom_example.pinc 2013-05-22 10:59:40 UTC (rev 1068) +++ trunk/php/db/table_custom_example.pinc 2013-05-23 07:26:14 UTC (rev 1069) @@ -106,6 +106,7 @@ type => "TX_TYPE", 'growonly' => true, // only append new text 'stamp' => true, // stamp with user & date + 'overview' => false, # do not show in overview constraints => "", Desc => "description 3", 'lang' => "DESC3"); @@ -125,6 +126,7 @@ type => "TS_TYPE", constraints => "", 'default_today' => false, + 'overview' => true, # show in overview Desc => "end date", 'lang' => "DATE3", 'hlang' => 'help for date3'); @@ -135,8 +137,10 @@ type => "float", constraints => "", Desc => "floater", + 'sortable' => true, # show in overview as sortable 'lang' => "FLOAT3", 'hlang' => "help for FLOAT3", + 'overview' => true, # show in overview 'required' => true); // // A boolean field @@ -148,6 +152,7 @@ Desc => "yes/no", 'lang' => "YES/NO", 'hlang' => 'help for bo', + 'overview' => true, # show in overview 'searchable' => true, 'required' => true); // @@ -158,6 +163,7 @@ type => "ID_TYPE", constraints => "", Desc => "optionlist", + 'overview' => true, # show in overview 'lang' => "OPTIONLIST", 'hlang' => "HOPTIONLIST", 'searchable' => true, Modified: trunk/php/product_overview.php =================================================================== --- trunk/php/product_overview.php 2013-05-22 10:59:40 UTC (rev 1068) +++ trunk/php/product_overview.php 2013-05-23 07:26:14 UTC (rev 1069) @@ -60,7 +60,7 @@ return $r; } - $flds = 0; + $this->flds = 0; $pf = 0; $n = count($this->plist); @@ -79,117 +79,118 @@ $r .= $this->OverviewHeadLineStart(); foreach ($tutos[prodfields] as $c) { - if ( ($c == "name") && $this->pshow[$c] ) { - $r .= $this->orderHeader("name",$lang['ProdName'],$this->link2); - $flds++; + if ( ($c == 'name') && $this->pshow[$c] ) { + $r .= $this->orderHeader('name',$lang['ProdName'],$this->link2); + $this->flds++; } - if ( ($c == "version") && $this->pshow[$c] ) { - $r .= $this->orderHeader("version",$lang['ProdVersion'],$this->link2); - $flds++; + if ( ($c == 'version') && $this->pshow[$c] ) { + $r .= $this->orderHeader('version',$lang['ProdVersion'],$this->link2); + $this->flds++; } if ( preg_match('#role_#',$c) && $this->pshow[$c] ) { foreach ( $lang['ProdRole'] as $ti => $tx) { if ( $c == 'role_'.$ti ) { $r .= $this->orderHeader('',$lang['ProdRole'][$ti],$this->link2); - $flds++; + $this->flds++; } } } - if ( ($c == "desc") && $this->pshow[$c] ) { - $r .= $this->orderHeader("description",$lang['ProdDesc'],$this->link2); - $flds++; + if ( ($c == 'desc') && $this->pshow[$c] ) { + $r .= $this->orderHeader('description',$lang['ProdDesc'],$this->link2); + $this->flds++; } - if ( ($c == "desc1") && $this->pshow[$c] ) { - $r .= $this->orderHeader("desc1",$lang['ProdDesc1'],$this->link2); - $flds++; + if ( ($c == 'desc1') && $this->pshow[$c] ) { + $r .= $this->orderHeader('desc1',$lang['ProdDesc1'],$this->link2); + $this->flds++; } - if ( ($c == "desc2") && $this->pshow[$c] ) { - $r .= $this->orderHeader("desc2",$lang['ProdDesc2'],$this->link2); - $flds++; + if ( ($c == 'desc2') && $this->pshow[$c] ) { + $r .= $this->orderHeader('desc2',$lang['ProdDesc2'],$this->link2); + $this->flds++; } - if ( ($c == "cl1") && $this->pshow[$c] ) { - $r .= $this->orderHeader("",$lang['ProdClass1'],$this->link2); - $flds++; + if ( ($c == 'cl1') && $this->pshow[$c] ) { + $r .= $this->orderHeader('',$lang['ProdClass1'],$this->link2); + $this->flds++; } - if ( ($c == "cl2") && $this->pshow[$c] ) { - $r .= $this->orderHeader("",$lang['ProdClass2'],$this->link2); - $flds++; + if ( ($c == 'cl2') && $this->pshow[$c] ) { + $r .= $this->orderHeader('',$lang['ProdClass2'],$this->link2); + $this->flds++; } - if ( ($c == "state") && $this->pshow[$c] ) { - $r .=$this-> orderHeader("state",$lang['ProdState'],$this->link2); - $flds++; + if ( ($c == 'state') && $this->pshow[$c] ) { + $r .=$this-> orderHeader('state',$lang['ProdState'],$this->link2); + $this->flds++; } - if ( ($c == "probability") && $this->pshow[$c] ) { - $r .= $this->orderHeader("probability",$lang['ProdProb'],$this->link2); - $flds++; + if ( ($c == 'probability') && $this->pshow[$c] ) { + $r .= $this->orderHeader('probability',$lang['ProdProb'],$this->link2); + $this->flds++; } - if ( ($c == "price") && $this->pshow[$c] ) { - $r .= $this->orderHeader("currency,price",$lang['ProdPrice'],$this->link2); - $flds++; - $pf = $flds; + if ( ($c == 'price') && $this->pshow[$c] ) { + $r .= $this->orderHeader('currency,price',$lang['ProdPrice'],$this->link2); + $this->flds++; + $pf = $this->flds; } - if ( ($c == "cost") && $this->pshow[$c] ) { - $r .= $this->orderHeader("currency,cost",$lang['ProdCost'],$this->link2); - $flds++; - $cf = $flds; + if ( ($c == 'cost') && $this->pshow[$c] ) { + $r .= $this->orderHeader('currency,cost',$lang['ProdCost'],$this->link2); + $this->flds++; + $cf = $this->flds; } - if ( ($c == "creator") && $this->pshow[$c] ) { - $r .= $this->orderHeader("",$lang['ProdCreator'],$this->link2); - $flds++; + if ( ($c == 'creator') && $this->pshow[$c] ) { + $r .= $this->orderHeader('',$lang['ProdCreator'],$this->link2); + $this->flds++; } - if ( ($c == "creation") && $this->pshow[$c] ) { - $r .= $this->orderHeader("creation",$lang['ProdCreationS'],$this->link2); - $flds++; + if ( ($c == 'creation') && $this->pshow[$c] ) { + $r .= $this->orderHeader('creation',$lang['ProdCreationS'],$this->link2); + $this->flds++; } if ( ($c == 'p_start') && $this->pshow[$c] ) { $r .= $this->orderHeader('p_start',$lang['ProdStart'],$this->link2); - $flds++; + $this->flds++; } if ( ($c == 'p_end') && $this->pshow[$c] ) { $r .= $this->orderHeader('p_end',$lang['ProdEnd'],$this->link2); - $flds++; + $this->flds++; } if ( $this->user->feature_ok(usebugtracking,PERM_SEE) ) { - if ( ($c == "pbugs") && $this->pshow[$c] ) { - $r .= $this->orderHeader("",$lang['Bugs'],$this->link2); - $flds++; + if ( ($c == 'pbugs') && $this->pshow[$c] ) { + $r .= $this->orderHeader('',$lang['Bugs'],$this->link2); + $this->flds++; } } if ( $this->user->feature_ok(usedocmanagement,PERM_SEE) ) { - if ( ($c == "pfile") && $this->pshow[$c] ) { - $r .= $this->orderHeader("",$lang['Files'],$this->link2); - $flds++; + if ( ($c == 'pfile') && $this->pshow[$c] ) { + $r .= $this->orderHeader('',$lang['Files'],$this->link2); + $this->flds++; } } if ( $this->user->feature_ok(usetaskmanagement,PERM_SEE) ) { - if ( ($c == "ptask") && $this->pshow[$c] ) { - $r .= $this->orderHeader("",$lang['Tasks'],$this->link2); - $flds++; + if ( ($c == 'ptask') && $this->pshow[$c] ) { + $r .= $this->orderHeader('',$lang['Tasks'],$this->link2); + $this->flds++; } } // Custom fields - foreach($table['product'] as $ti => $tx) { - if (!is_array($tx)) continue; - if (!isset($tx['custom'])) continue; - if (!$tx['custom']) continue; - if (!isset($tx['ftype'])) $tx['ftype'] = ''; + foreach(get_custom_overview_fields($this,'product') as $ti => $tx) { if ( ($c == 'p_c_'.$ti) && $this->pshow[$c] ) { - $r .= $this->orderHeader('',myentities(isset($lang[$tx['lang']]) ? $lang[$tx['lang']]:$tx['lang']),$this->link2); - $flds++; + if (isset($tx['sortable']) && ($tx['sortable'] == true) ) { + $sortby = $ti; + } else { + $sortby = ''; + } + $r .= $this->orderHeader($sortby,myentities(isset($lang[$tx['lang']]) ? $lang[$tx['lang']]:$tx['lang']),$this->link2); + $this->flds++; } } if ( ($c == 'checkbox') && $this->pshow[$c] ) { // Column for checkboxes $r .= $this->MassupdateHeader(); - $flds++; + $this->flds++; } } $r .= $this->OverviewHeadLineEnd(); $r .= $this->OverviewHeadEnd(); $r .= $this->OverviewBodyStart(); - if ( $this->format == "paper" ) { + if ( $this->format == 'paper' ) { $a = 0; $end = $n; } else if ( $this->start == -1 ) { @@ -212,7 +213,7 @@ } $p->readroles(); - $r .= $this->OverviewRowStart($line,$lang[$p->getType()] .": ". $p->getFullName()); + $r .= $this->OverviewRowStart($line,$lang[$p->getType()] .': '. $p->getFullName()); foreach ($tutos[prodfields] as $c) { if (! $this->pshow[$c]) { continue; @@ -318,7 +319,7 @@ $r .= $this->OverviewBodyEnd(); $r .= $this->OverviewFootStart(); - $r .= $this->list_navigation(addUrlParameter($this->link1,'ss='.$this->ss),$flds,$this->start,$a,$n); + $r .= $this->list_navigation(addUrlParameter($this->link1,'ss='.$this->ss),$this->flds,$this->start,$a,$n); // Sum of Prices if ( ($this->pshow['price'] == 1) || ($this->pshow['cost'] == 1) ) { @@ -328,13 +329,13 @@ if ( $this->pshow[$c] == 0 ) { continue; } - if ( $c == "price" ) { + if ( $c == 'price' ) { if ( $fill > 0 ) { $r .= ' <td colspan="'. $fill ."\"> </td>\n"; $fill = 0; } $r .= " <td align=\"right\">\n"; - $pre = ""; + $pre = ''; foreach ($sum[1] as $i1 => $f1) { if ( $f1 ) { $r .= $pre . my_number_format($f1,2) .' '. $i1; @@ -342,13 +343,13 @@ } } $r .= " </td>\n"; - } else if ( $c == "cost" ) { + } else if ( $c == 'cost' ) { if ( $fill > 0 ) { $r .= " <td colspan=\"". $fill ."\"> </td>\n"; $fill = 0; } $r .= " <td align=\"right\">\n"; - $pre = ""; + $pre = ''; foreach ($sum[2] as $i1 => $f1) { if ( $f1 ) { $r .= $pre . my_number_format($f1,2) .' '. $i1; @@ -373,7 +374,7 @@ $this->addHidden('name',''); } // Mass Update - $r .= $this->UpdateRowStart($flds-1); + $r .= $this->UpdateRowStart($this->flds -1); $r .= sprintf($lang['withmarked'],$lang['ProductPs']); $r .= " <select name=\"action\">\n"; $r .= " <option value=\"-1\" selected=\"selected\">". $lang['ActionNil'] ."</option>\n"; @@ -757,12 +758,7 @@ $this->flds['p_start'] = 'ProdStart'; $this->flds['p_end'] = 'ProdEnd'; // Custom fields - foreach($table['product'] as $ti => $tx) { - if (!is_array($tx)) continue; - if (!isset($tx['custom'])) continue; - if (!$tx['custom']) continue; - if (!isset($tx['ftype'])) $tx['ftype'] = ''; - + foreach(get_custom_overview_fields($this,'product') as $ti => $tx) { $this->flds['p_c_'.$ti] = $tx['lang']; $tutos[prodfields][] = 'p_c_'.$ti; } @@ -781,8 +777,8 @@ $x = sprintf("cl%d",$cl); $this->flds['cl'.$cl] = 'ProdClass'.$cl; } - $this->flds['checkbox'] = ''; - $tutos[prodfields][] = 'checkbox'; + $this->flds['checkbox'] = ''; + $tutos[prodfields][] = 'checkbox'; foreach($tutos[prodfields] as $c) { $this->pshow[$c] = 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-05-22 10:59:42
|
Revision: 1068 http://sourceforge.net/p/tutos/code/1068 Author: gokohnert Date: 2013-05-22 10:59:40 +0000 (Wed, 22 May 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/php/pdf2.pinc Modified: trunk/php/pdf2.pinc =================================================================== --- trunk/php/pdf2.pinc 2013-05-21 09:30:33 UTC (rev 1067) +++ trunk/php/pdf2.pinc 2013-05-22 10:59:40 UTC (rev 1068) @@ -45,7 +45,7 @@ $this->setTopMargin(18); $this->setHeaderMargin(0); $this->setFooterMargin(5); - + $this->footer_central = ''; } // overwrite Header function This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |