phpslash-commit Mailing List for phpSlash (Page 88)
Brought to you by:
joestewart,
nhruby
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(59) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(52) |
Feb
(77) |
Mar
(118) |
Apr
(76) |
May
(106) |
Jun
(145) |
Jul
(9) |
Aug
(15) |
Sep
(78) |
Oct
(83) |
Nov
(105) |
Dec
(51) |
2003 |
Jan
(105) |
Feb
(100) |
Mar
(111) |
Apr
(149) |
May
(95) |
Jun
(56) |
Jul
(8) |
Aug
(2) |
Sep
|
Oct
(22) |
Nov
(117) |
Dec
(6) |
2004 |
Jan
(1) |
Feb
|
Mar
(3) |
Apr
(25) |
May
|
Jun
(11) |
Jul
(26) |
Aug
(85) |
Sep
(119) |
Oct
(312) |
Nov
(271) |
Dec
(5) |
2005 |
Jan
(6) |
Feb
|
Mar
|
Apr
(12) |
May
(7) |
Jun
(8) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Joe S. <joe...@us...> - 2002-05-30 16:00:20
|
Update of /cvsroot/phpslash/phpslash-ft/doc/html In directory usw-pr-cvs1:/tmp/cvs-serv7746/phpslash-ft/doc/html Modified Files: phpslash.sgml Log Message: QUERY_STRING tweaks Index: phpslash.sgml =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/doc/html/phpslash.sgml,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** phpslash.sgml 24 May 2002 16:00:26 -0000 1.31 --- phpslash.sgml 30 May 2002 16:00:16 -0000 1.32 *************** *** 760,763 **** --- 760,764 ---- registerform.tpl openbox.tpl + skinsblock.tpl </code></tscreen> *************** *** 1039,1042 **** --- 1040,1044 ---- "home" link. <tag/Section/ Will give you a list of the sections with stories. + <tag/Skin/ Will display a list of links to change the current skin. <tag/Submission/ Will give a list of the submissions in a block to a user with sufficient privileges. This block uses the submissionList.tpl |
From: Joe S. <joe...@us...> - 2002-05-24 17:03:24
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/templates/en/default In directory usw-pr-cvs1:/tmp/cvs-serv5020/phpslash-ft/public_html/templates/en/default Removed Files: footer.tpl Log Message: removed unused templates --- footer.tpl DELETED --- |
From: Joe S. <joe...@us...> - 2002-05-24 17:03:23
|
Update of /cvsroot/phpslash/phpslash-ft/doc/html In directory usw-pr-cvs1:/tmp/cvs-serv5020/phpslash-ft/doc/html Modified Files: phpslash.sgml Log Message: removed unused templates Index: phpslash.sgml =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/doc/html/phpslash.sgml,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** phpslash.sgml 24 May 2002 15:26:52 -0000 1.30 --- phpslash.sgml 24 May 2002 16:00:26 -0000 1.31 *************** *** 1357,1361 **** <tscreen><verb> about.tpl - About page - admin.tpl - deprecated article-pf.tpl - printer friendly article page article.tpl - deprecated --- 1357,1360 ---- *************** *** 1395,1404 **** fancybox.tpl - blocks framedbox.tpl - alternate fancybox - footer.tpl - unused glossaryList.tpl - list of glossary entries in glossaryAdmin glossaryNew.tpl - manage glossary entry in glossaryAdmin glossarySearch.tpl - glossary display - header.tpl - unused - index.tpl - deprecated index1col.tpl - one column index and article page index2colleft.tpl - two column index and article page w/left hand blocks --- 1394,1400 ---- |
From: Joe S. <joe...@us...> - 2002-05-24 17:03:21
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/templates/en/basic In directory usw-pr-cvs1:/tmp/cvs-serv5644/phpslash-ft/public_html/templates/en/basic Removed Files: header.tpl admin.tpl index.tpl footer.tpl Log Message: removed unused templates --- header.tpl DELETED --- --- admin.tpl DELETED --- --- index.tpl DELETED --- --- footer.tpl DELETED --- |
From: Joe S. <joe...@us...> - 2002-05-24 17:03:21
|
Update of /cvsroot/phpslash/phpslash-ft In directory usw-pr-cvs1:/tmp/cvs-serv5020/phpslash-ft Modified Files: CHANGES Log Message: removed unused templates Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.495 retrieving revision 1.496 diff -C2 -d -r1.495 -r1.496 *** CHANGES 24 May 2002 15:25:16 -0000 1.495 --- CHANGES 24 May 2002 16:00:25 -0000 1.496 *************** *** 13,16 **** --- 13,21 ---- 9 - Removal of something (kill -9 :) + 2002-May-24 11:00AM CDT Joe Stewart <joe...@us...> + [T] - removed unused templates - header.tpl, footer.tpl, admin.tpl, + and index.tpl. + [D] - phpslash.sgml - removed references to unused templates. + 2002-May-24 10:00AM CDT Joe Stewart <joe...@us...> [E] - Author.class, slashAuthCR.class - existing author records can login. |
From: Joe S. <joe...@us...> - 2002-05-24 17:03:17
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/templates/en/default In directory usw-pr-cvs1:/tmp/cvs-serv5311/phpslash-ft/public_html/templates/en/default Removed Files: header.tpl admin.tpl index.tpl Log Message: removed unused templates --- header.tpl DELETED --- --- admin.tpl DELETED --- --- index.tpl DELETED --- |
From: Joe S. <joe...@us...> - 2002-05-24 15:26:54
|
Update of /cvsroot/phpslash/phpslash-ft/doc/html In directory usw-pr-cvs1:/tmp/cvs-serv27179/phpslash-ft/doc/html Modified Files: phpslash.sgml Log Message: existing user login Index: phpslash.sgml =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/doc/html/phpslash.sgml,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** phpslash.sgml 23 May 2002 18:44:11 -0000 1.29 --- phpslash.sgml 24 May 2002 15:26:52 -0000 1.30 *************** *** 1078,1082 **** <item>glossary - manage glossary <item>groupAdmin - manage user groups ! <item>infolog - view and manage the event logging <item>mailinglist - manage Mailinglist <item>permissionAdmin - manage Permissions ( must have groupAdmin too) --- 1078,1082 ---- <item>glossary - manage glossary <item>groupAdmin - manage user groups ! <item>logging - view and manage the event logging <item>mailinglist - manage Mailinglist <item>permissionAdmin - manage Permissions ( must have groupAdmin too) *************** *** 1195,1199 **** <item>glossary - manage glossary <item>groupAdmin - manage user groups ! <item>infolog - view and manage the event logging <item>mailinglist - manage Mailinglist <item>permissionAdmin - manage Permissions ( must have groupAdmin too) --- 1195,1199 ---- <item>glossary - manage glossary <item>groupAdmin - manage user groups ! <item>logging - view and manage the event logging <item>mailinglist - manage Mailinglist <item>permissionAdmin - manage Permissions ( must have groupAdmin too) |
From: Joe S. <joe...@us...> - 2002-05-24 15:26:39
|
Update of /cvsroot/phpslash/phpslash-ft/tables/0.7 In directory usw-pr-cvs1:/tmp/cvs-serv27048/phpslash-ft/tables/0.7 Modified Files: slash-all.sql 65_to_7.sql Log Message: existing user login Index: slash-all.sql =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/tables/0.7/slash-all.sql,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** slash-all.sql 23 May 2002 18:38:53 -0000 1.1 --- slash-all.sql 24 May 2002 15:26:36 -0000 1.2 *************** *** 501,505 **** INSERT INTO psl_group VALUES (9,'glossary','Glossary Admin'); INSERT INTO psl_group VALUES (10,'groupAdmin','Group Admin'); ! INSERT INTO psl_group VALUES (11,'infolog','Infolog Admin'); INSERT INTO psl_group VALUES (12,'mailinglist','Mailing List Admin'); INSERT INTO psl_group VALUES (13,'permissionAdmin','Permission Admin'); --- 501,505 ---- INSERT INTO psl_group VALUES (9,'glossary','Glossary Admin'); INSERT INTO psl_group VALUES (10,'groupAdmin','Group Admin'); ! INSERT INTO psl_group VALUES (11,'logging','Infolog Admin'); INSERT INTO psl_group VALUES (12,'mailinglist','Mailing List Admin'); INSERT INTO psl_group VALUES (13,'permissionAdmin','Permission Admin'); Index: 65_to_7.sql =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/tables/0.7/65_to_7.sql,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** 65_to_7.sql 23 May 2002 19:21:28 -0000 1.2 --- 65_to_7.sql 24 May 2002 15:26:36 -0000 1.3 *************** *** 46,50 **** INSERT INTO psl_group VALUES (9,'glossary','Glossary Admin'); INSERT INTO psl_group VALUES (10,'groupAdmin','Group Admin'); ! INSERT INTO psl_group VALUES (11,'infolog','Infolog Admin'); INSERT INTO psl_group VALUES (12,'mailinglist','Mailing List Admin'); INSERT INTO psl_group VALUES (13,'permissionAdmin','Permission Admin'); --- 46,50 ---- INSERT INTO psl_group VALUES (9,'glossary','Glossary Admin'); INSERT INTO psl_group VALUES (10,'groupAdmin','Group Admin'); ! INSERT INTO psl_group VALUES (11,'logging','Infolog Admin'); INSERT INTO psl_group VALUES (12,'mailinglist','Mailing List Admin'); INSERT INTO psl_group VALUES (13,'permissionAdmin','Permission Admin'); |
From: Joe S. <joe...@us...> - 2002-05-24 15:25:18
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory usw-pr-cvs1:/tmp/cvs-serv26573/phpslash-ft/class Modified Files: slashAuthCR.class Author.class Log Message: existing user login Index: slashAuthCR.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/slashAuthCR.class,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** slashAuthCR.class 23 May 2002 20:38:44 -0000 1.12 --- slashAuthCR.class 24 May 2002 15:25:16 -0000 1.13 *************** *** 208,212 **** } // may need to get legacy records ! // $this->auth["perm"] = $this->db->Record["perms"]; $this->auth["perm"] = $this->get_userperms( $uid); --- 208,212 ---- } // may need to get legacy records ! $this->auth["perm"] = $this->db->Record["perms"]; $this->auth["perm"] = $this->get_userperms( $uid); Index: Author.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Author.class,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Author.class 23 May 2002 20:38:44 -0000 1.21 --- Author.class 24 May 2002 15:25:16 -0000 1.22 *************** *** 437,441 **** $author_id = $this->db->Record['author_id']; // $author_perms = $this->db->Record['perms']; ! $this->author_templ->set_block("newauthor","perm_row","perm_rows"); $this->author_templ->set_block("newauthor","permhave_row","permhave_rows"); --- 437,442 ---- $author_id = $this->db->Record['author_id']; // $author_perms = $this->db->Record['perms']; ! $tauthor_perms = explode(',',$this->db->Record['perms'] ); ! $this->author_templ->set_block("newauthor","perm_row","perm_rows"); $this->author_templ->set_block("newauthor","permhave_row","permhave_rows"); *************** *** 465,475 **** // debug("q", $q); $this->db->query($q); ! // $i = 0; ! while ($this->db->next_record()) { $author_perms[$this->db->Record['group_name']] = $this->db->Record['group_id']; ! // $i++; } while(list($k, $v) = each($allperms_ary)) { if(is_array($v)) { --- 466,487 ---- // debug("q", $q); $this->db->query($q); ! ! $i = 0; while ($this->db->next_record()) { $author_perms[$this->db->Record['group_name']] = $this->db->Record['group_id']; ! $i++; } + // read in legacy records + + if($i == 0) { + //debug("this->db->Record[perms]", $this->db->Record['perms']); + //$tauthor_perms = explode(',',$this->db->Record['perms'] ); + debug ("tauthor_perms", $tauthor_perms); + while(list($k, $v) = each($tauthor_perms)) { + $author_perms[$v] = true; + } + } + debug ("author_perms", $author_perms); while(list($k, $v) = each($allperms_ary)) { if(is_array($v)) { |
From: Joe S. <joe...@us...> - 2002-05-24 15:25:18
|
Update of /cvsroot/phpslash/phpslash-ft In directory usw-pr-cvs1:/tmp/cvs-serv26573/phpslash-ft Modified Files: CHANGES Log Message: existing user login Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.494 retrieving revision 1.495 diff -C2 -d -r1.494 -r1.495 *** CHANGES 23 May 2002 20:38:44 -0000 1.494 --- CHANGES 24 May 2002 15:25:16 -0000 1.495 *************** *** 13,16 **** --- 13,22 ---- 9 - Removal of something (kill -9 :) + 2002-May-24 10:00AM CDT Joe Stewart <joe...@us...> + [E] - Author.class, slashAuthCR.class - existing author records can login. + slash-all.sql, 65_to_7.sql - logging permission is what has been used + instead of infolog. + [D] - phpslash.sgml - changed references of infolog permissions to logging. + 2002-May-23 3:30PM CDT Joe Stewart <joe...@us...> [E] - Author.class, slashAuthCR.class - cleanup of deleteAuthor, auth_preauth, |
From: Joe S. <joe...@us...> - 2002-05-23 20:38:47
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory usw-pr-cvs1:/tmp/cvs-serv26220/phpslash-ft/class Modified Files: Author.class slashAuthCR.class Log Message: preauth fix Index: Author.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Author.class,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Author.class 23 May 2002 18:41:24 -0000 1.20 --- Author.class 23 May 2002 20:38:44 -0000 1.21 *************** *** 164,167 **** --- 164,171 ---- } + $group_del = "DELETE FROM psl_author_group_lut + WHERE author_id='$ary[author_id]'"; + $this->db->query($group_del); + $this->message = "Author Updated"; *************** *** 199,203 **** if(is_array($ary['permission']) ) { ! while ( list( $key, $val ) = each( $ary['permission'] ) ) { $lut_id = generateID("psl_author_group_lut_seq"); $lut_insert = "INSERT INTO psl_author_group_lut --- 203,208 ---- if(is_array($ary['permission']) ) { ! ! while ( list( $key, $val ) = each( $ary['permission'] ) ) { $lut_id = generateID("psl_author_group_lut_seq"); $lut_insert = "INSERT INTO psl_author_group_lut *************** *** 327,330 **** --- 332,340 ---- return false; } else { + + $q = "DELETE + FROM psl_author_group_lut + WHERE author_id = '$author_id_to_delete'"; + $this->db->query($q); $q = "DELETE Index: slashAuthCR.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/slashAuthCR.class,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** slashAuthCR.class 23 May 2002 18:41:24 -0000 1.11 --- slashAuthCR.class 23 May 2002 20:38:44 -0000 1.12 *************** *** 113,121 **** // preauth successful // debug("preauth", "successful"); ! $this->auth["perm"] = $this->db->Record["perms"]; ! return $this->db->Record["author_id"]; } else { // preauth failed ! // debug("preauth", "failed"); return false; } --- 113,123 ---- // preauth successful // debug("preauth", "successful"); ! // $this->auth["perm"] = $this->db->Record["perms"]; ! $uid = $this->db->Record["author_id"]; ! $this->auth["perm"] = $this->get_userperms($uid); ! return $uid; } else { // preauth failed ! debug("preauth", "failed"); return false; } *************** *** 194,285 **** return false; } else { ! // may need to get legacy records ! // $this->auth["perm"] = $this->db->Record["perms"]; ! /* ! * Get the group perms's for this author into an array ! */ ! $q = "SELECT psl_permission.permission_name, ! psl_group.group_name, ! psl_group.group_id ! FROM psl_group, ! psl_author_group_lut, ! psl_group_permission_lut, ! psl_permission ! WHERE psl_group.group_id = psl_author_group_lut.group_id ! AND psl_group.group_id = psl_group_permission_lut.group_id ! AND psl_group_permission_lut.permission_id = psl_permission.permission_id ! AND psl_author_group_lut.author_id = '$uid' "; ! // debug("q", $q); ! $this->db->query($q); ! ! while ($this->db->next_record()) { ! $group_id = $this->db->Record[group_id]; ! $this->auth["perm"][$this->db->Record['group_name']][$this->db->Record['permission_name']] = true; ! $q = "SELECT section_id ! FROM psl_group_section_lut ! WHERE group_id = '$group_id' "; ! $db2 = new slashDB; ! // debug("q", $q); ! $db2->query($q); ! while ($db2->next_record()) { ! $this->auth["perm"][$this->db->Record['group_name']][$db2->Record['section_id']] = true; ! } ! ! ! } ! ! /* ! * Get the group->group perm's for this author into an array ! */ ! ! // first get all the group names in an array ! $q = "SELECT group_name, ! group_id ! FROM psl_group "; ! // debug("q", $q); ! $this->db->query($q); ! ! while ($this->db->next_record()) { ! $groups_ary[$this->db->Record['group_id']] = $this->db->Record['group_name']; ! } ! ! $q = "SELECT psl_group_group_lut.group_id, ! psl_group_group_lut.childgroup_id ! FROM psl_author_group_lut, ! psl_group_group_lut ! WHERE psl_group_group_lut.group_id = psl_author_group_lut.group_id ! AND psl_author_group_lut.author_id = '$uid' "; ! // debug("q", $q); ! $this->db->query($q); ! ! while ($this->db->next_record()) { ! $group_id = $this->db->Record['group_id']; ! $childgroup_id = $this->db->Record['childgroup_id']; ! ! $group_name = $groups_ary[$group_id]; ! $childgroup_name = $groups_ary[$childgroup_id]; ! ! if( is_array($this->auth['perm'][$childgroup_name])) { ! $this->auth['perm'][$group_name][$childgroup_name] = $this->auth['perm'][$childgroup_name]; ! } else { ! // query to get group perms ! $q = "SELECT psl_permission.permission_name ! FROM psl_group_permission_lut, ! psl_permission ! WHERE psl_group_permission_lut.permission_id = psl_permission.permission_id ! AND psl_group_permission_lut.group_id = '$childgroup_id' "; ! // debug("q", $q); ! $db2 = new slashDB; ! $db2->query($q); ! ! while ($db2->next_record()) { ! $this->auth['perm'][$group_name][$childgroup_name][$db2->Record['permission_name']] = true; ! } ! ! } ! ! } ! ! if(isset($setcookie)){ $cookie_challenge = md5($this->magic .":". $this->psl['basedir']); $md5_pw = $this->db->Record['password']; // this is the raw MD5ed user/pass combo --- 196,200 ---- return false; } else { ! if(isset($setcookie)){ $cookie_challenge = md5($this->magic .":". $this->psl['basedir']); $md5_pw = $this->db->Record['password']; // this is the raw MD5ed user/pass combo *************** *** 292,295 **** --- 207,214 ---- setcookie( 'user_info', base64_encode(serialize($cookie_ary)), time()+31536000,$this->psl['rooturl'] , "" , ""); } + // may need to get legacy records + // $this->auth["perm"] = $this->db->Record["perms"]; + $this->auth["perm"] = $this->get_userperms( $uid); + return $uid; } *************** *** 404,411 **** $this->auth["uid"] = $this->db->f("author_id"); $this->auth["uname"] = $this->db->f("author_name"); ! $this->auth["perm"] = $this->db->f("perms"); $this->auth["email"] = $this->db->f("email"); $this->auth["realname"] = $this->db->f("realname"); ! return $uid; } ## If user is present and password does not match, --- 323,331 ---- $this->auth["uid"] = $this->db->f("author_id"); $this->auth["uname"] = $this->db->f("author_name"); ! // $this->auth["perm"] = $this->db->f("perms"); $this->auth["email"] = $this->db->f("email"); $this->auth["realname"] = $this->db->f("realname"); ! // $this->auth["perm"] = $this->get_userperms($uid); ! return $uid; } ## If user is present and password does not match, *************** *** 425,431 **** $ary["author_realname"] = $realname; $ary["seclev"] = $seclev; ! $perm_ary = array("nobody", ! "user"); ! $ary["permission"] = $perm_ary; --- 345,351 ---- $ary["author_realname"] = $realname; $ary["seclev"] = $seclev; ! // temporary kludge to fix registration ! $perm_ary['nobody'] = 20; ! $perm_ary['user'] = 21; $ary["permission"] = $perm_ary; *************** *** 449,454 **** } ! } } --- 369,462 ---- } ! } + + function get_userperms($uid) { + + /* + * Get the group perms's for this author into an array + */ + $q = "SELECT psl_permission.permission_name, + psl_group.group_name, + psl_group.group_id + FROM psl_group, + psl_author_group_lut, + psl_group_permission_lut, + psl_permission + WHERE psl_group.group_id = psl_author_group_lut.group_id + AND psl_group.group_id = psl_group_permission_lut.group_id + AND psl_group_permission_lut.permission_id = psl_permission.permission_id + AND psl_author_group_lut.author_id = '$uid' "; + + // debug("q", $q); + $this->db->query($q); + + while ($this->db->next_record()) { + $group_id = $this->db->Record[group_id]; + $this->auth["perm"][$this->db->Record['group_name']][$this->db->Record['permission_name']] = true; + $q = "SELECT section_id + FROM psl_group_section_lut + WHERE group_id = '$group_id' "; + $db2 = new slashDB; + // debug("q", $q); + $db2->query($q); + while ($db2->next_record()) { + $this->auth["perm"][$this->db->Record['group_name']][$db2->Record['section_id']] = true; + } + } + + /* + * Get the group->group perm's for this author into an array + */ + + // first get all the group names in an array + $q = "SELECT group_name, + group_id + FROM psl_group "; + // debug("q", $q); + $this->db->query($q); + + while ($this->db->next_record()) { + $groups_ary[$this->db->Record['group_id']] = $this->db->Record['group_name']; + } + + $q = "SELECT psl_group_group_lut.group_id, + psl_group_group_lut.childgroup_id + FROM psl_author_group_lut, + psl_group_group_lut + WHERE psl_group_group_lut.group_id = psl_author_group_lut.group_id + AND psl_author_group_lut.author_id = '$uid' "; + // debug("q", $q); + $this->db->query($q); + + while ($this->db->next_record()) { + $group_id = $this->db->Record['group_id']; + $childgroup_id = $this->db->Record['childgroup_id']; + + $group_name = $groups_ary[$group_id]; + $childgroup_name = $groups_ary[$childgroup_id]; + + if( is_array($this->auth['perm'][$childgroup_name])) { + $this->auth['perm'][$group_name][$childgroup_name] = $this->auth['perm'][$childgroup_name]; + } else { + // query to get group perms + $q = "SELECT psl_permission.permission_name + FROM psl_group_permission_lut, + psl_permission + WHERE psl_group_permission_lut.permission_id = psl_permission.permission_id + AND psl_group_permission_lut.group_id = '$childgroup_id' "; + // debug("q", $q); + $db2 = new slashDB; + $db2->query($q); + + while ($db2->next_record()) { + $this->auth['perm'][$group_name][$childgroup_name][$db2->Record['permission_name']] = true; + } + + } // endif + + } //end while + return $this->auth['perm']; + } // end of function get_userperms() } |
From: Joe S. <joe...@us...> - 2002-05-23 20:38:47
|
Update of /cvsroot/phpslash/phpslash-ft In directory usw-pr-cvs1:/tmp/cvs-serv26220/phpslash-ft Modified Files: CHANGES Log Message: preauth fix Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.493 retrieving revision 1.494 diff -C2 -d -r1.493 -r1.494 *** CHANGES 23 May 2002 18:41:24 -0000 1.493 --- CHANGES 23 May 2002 20:38:44 -0000 1.494 *************** *** 13,16 **** --- 13,20 ---- 9 - Removal of something (kill -9 :) + 2002-May-23 3:30PM CDT Joe Stewart <joe...@us...> + [E] - Author.class, slashAuthCR.class - cleanup of deleteAuthor, auth_preauth, + validatelogin, and kludge of doregister. + 2002-May-23 1:00PM CDT Joe Stewart <joe...@us...> [EST] - Experimental Permission Groups for testing. Affected files: |
From: Joe S. <joe...@us...> - 2002-05-23 19:21:31
|
Update of /cvsroot/phpslash/phpslash-ft/tables/0.7 In directory usw-pr-cvs1:/tmp/cvs-serv4222/0.7 Modified Files: 65_to_7.sql Log Message: Permission Groups Index: 65_to_7.sql =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/tables/0.7/65_to_7.sql,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** 65_to_7.sql 23 May 2002 18:38:53 -0000 1.1 --- 65_to_7.sql 23 May 2002 19:21:28 -0000 1.2 *************** *** 8,11 **** --- 8,27 ---- INSERT INTO db_sequence VALUES ('psl_group_group_lut_seq',64); INSERT INTO db_sequence VALUES ('psl_author_group_lut_seq',26); + + CREATE TABLE psl_author_group_lut ( + lut_id int(11) unsigned NOT NULL default '0', + author_id int(11) unsigned default NULL, + group_id int(11) unsigned default NULL, + UNIQUE KEY lut_id_2 (lut_id), + KEY lut_id (lut_id) + ) TYPE=MyISAM; + + # + # Dumping data for table 'psl_author_group_lut' + # + + INSERT INTO psl_author_group_lut VALUES (26,1,24); + + # # Table structure for table 'psl_group' |
From: Joe S. <joe...@us...> - 2002-05-23 18:44:14
|
Update of /cvsroot/phpslash/phpslash-ft/doc/html In directory usw-pr-cvs1:/tmp/cvs-serv24706/html Modified Files: phpslash.sgml Log Message: Permission Groups Index: phpslash.sgml =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/doc/html/phpslash.sgml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** phpslash.sgml 20 May 2002 22:03:48 -0000 1.28 --- phpslash.sgml 23 May 2002 18:44:11 -0000 1.29 *************** *** 1066,1070 **** <sect1>Authors ! <p> Add new authors here <sect1>Variables --- 1066,1093 ---- <sect1>Authors ! <p> Add new authors and manage existing authors here. This is where new users ! are added. ! ! Default permission groups: ! <itemize> ! <item>nobody - anonymous ! <item>user - ability to login ! <item>author - manage users(authors) ! <item>block - manage blocks ! <item>comment - moderate comments ! <item>glossary - manage glossary ! <item>groupAdmin - manage user groups ! <item>infolog - view and manage the event logging ! <item>mailinglist - manage Mailinglist ! <item>permissionAdmin - manage Permissions ( must have groupAdmin too) ! <item>poll - manage Polls ! <item>root - all privileges ! <item>section - manage sections ! <item>story - can create stories ! <item>storyeditor - can create and manage other author's stories ! <item>submission - manage submissions ! <item>topic - manage topics ! <item>variable - manage variables ! </itemize> <sect1>Variables *************** *** 1091,1095 **** your site data anywhere. ! <sect2>Seting up <p> Make sure you edit the $metatags, site_owner, Site_title and site_slogan entries in config.php3. These are used by the export module. --- 1114,1118 ---- your site data anywhere. ! <sect2>Setting up <p> Make sure you edit the $metatags, site_owner, Site_title and site_slogan entries in config.php3. These are used by the export module. *************** *** 1158,1161 **** --- 1181,1214 ---- the 'net. Once place to start is <url url="http://www.syndic8.com" name="syndic8.com"> + <sect1>Groups + <p> The Groups module manages user groups and permissions. Users are assigned to groups in the Author administration module. + + Groups can be created from a list of individual permissions or other groups of permissions. They can be attached to specific sections or ( by default) apply toall sections. + + Default permission groups: + <itemize> + <item>nobody - anonymous + <item>user - ability to login + <item>author - manage users(authors) + <item>block - manage blocks + <item>comment - moderate comments + <item>glossary - manage glossary + <item>groupAdmin - manage user groups + <item>infolog - view and manage the event logging + <item>mailinglist - manage Mailinglist + <item>permissionAdmin - manage Permissions ( must have groupAdmin too) + <item>poll - manage Polls + <item>root - all privileges + <item>section - manage sections + <item>story - can create stories + <item>storyeditor - can create and manage other author's stories + <item>submission - manage submissions + <item>topic - manage topics + <item>variable - manage variables + </itemize> + + <sect2>Caveats: + <p>If a new permission is created, the root group does not automatically have this permission. + <!-- START SECTION: Templates --> |
From: Joe S. <joe...@us...> - 2002-05-23 18:43:45
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/templates/en/basic In directory usw-pr-cvs1:/tmp/cvs-serv24564/basic Modified Files: authorNew.tpl Added Files: groupNew.tpl groupList.tpl permissionNew.tpl permissionList.tpl Log Message: Permission Groups --- NEW FILE: groupNew.tpl --- <!-- Start groupNew.tpl --> <div id="topicNew"> <form action="{ACTION_URL}" method="post"> <input type="hidden" name="group_id" value="{GROUP_ID}" /> <table border="0"> <tr> <td class="descr">Name</td> <td><input type="text" name="group_name" value="{GROUP_NAME}" /></td> </tr> <tr> <td class="descr">Description</td> <td> <textarea name="description" wrap=physical cols=30 rows=4>{GROUP_DESCRIPTION}</textarea> </td> </tr> <tr> <td class="descr">Section(s):</td> <td><select size={SIZE} multiple name=section_id_ary[]> <!-- BEGIN section_row --> <option value="{SECTION_ID}" {SELECTED}>{SECTION_NAME}</option> <!-- END section_row --> </select> </td> </tr> <tr> <td class="descr">Groups:</td> <td> <select size={SIZE} multiple name=group_id_ary[]> <!-- BEGIN group_row --> <option value="{CHILDGROUP_ID}" {SELECTED}>{CHILDGROUP_NAME}</option> <!-- END group_row --> </select> </td> </tr> <tr> <td class="descr">Permissions:</td> <td> <select size={SIZEPERMS} multiple name=perm_id_ary[]> <!-- BEGIN permission_row --> <option value="{PERMISSION_ID}" {SELECTED}>{PERMISSION_NAME}</option> <!-- END permission_row --> </select> </td> </tr> <tr> <td> </td> <td><input type="submit" name="submit" value="submit" /></td> </tr> </table> </form> </div> <!-- id="groupNew" --> <!-- End groupNew.tpl --> --- NEW FILE: groupList.tpl --- <!-- groupList.tpl --> <TABLE BORDER=0 CELLPADDING=3> <TR> <TD><b>ID</b></TD> <TD><b>Name</b></TD> <TD><b>Actions</b></TD> </TR> <!-- BEGIN row --> <TR> <TD>{GROUP_ID}</TD> <TD>{GROUP_NAME}</TD> <TD>{ADMIN}</TD> </TR> <!-- END row --> </TABLE> <!-- groupList.tpl --> --- NEW FILE: permissionNew.tpl --- <!-- permissionNew.tpl --> <form action="{ACTION_URL}" method="post"> <input type="hidden" name="permission_id" value="{PERMISSION_ID}"> <table border=0> <tr> <td class="descr">Name</td> <td><input type="text" name="permission_name" value="{PERMISSION_NAME}"></td> </tr> <tr> <td class="descr">Description</td> <td><textarea name="description" wrap="physical" cols="30" rows="4">{PERMISSION_DESCRIPTION}</textarea></td> </tr> <tr> <td> </td> <td><input type="submit" name="submit" value="submitperm"></td> </tr> </table> </form> <!-- permissionNew.tpl --> --- NEW FILE: permissionList.tpl --- <!-- permissionList.tpl --> <TABLE BORDER=0 CELLPADDING=3> <TR> <TD><b>ID</b></TD> <TD><b>Name</b></TD> <TD><b>Actions</b></TD> </TR> <!-- BEGIN row --> <TR> <TD>{PERMISSION_ID}</TD> <TD>{PERMISSION_NAME}</TD> <TD>{ADMIN}</TD> </TR> <!-- END row --> </TABLE> <!-- permissionList.tpl --> Index: authorNew.tpl =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/templates/en/basic/authorNew.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** authorNew.tpl 9 Apr 2002 16:57:06 -0000 1.2 --- authorNew.tpl 23 May 2002 18:43:42 -0000 1.3 *************** *** 35,42 **** <td> <!-- BEGIN perm_row --> ! <input name="permission[]" value="{PERM}" type="checkbox" />{PERM}<br /> <!-- END perm_row --> <!-- BEGIN permhave_row --> ! <input name="permission[]" value="{PERM}" type="checkbox" checked="checked" />{PERM}<br /> <!-- END permhave_row --> </td> --- 35,42 ---- <td> <!-- BEGIN perm_row --> ! <input name="permission[{PERM}]" value="{PERM_VALUE}" type="checkbox" />{PERM}{GROUP}<br /> <!-- END perm_row --> <!-- BEGIN permhave_row --> ! <input name="permission[{PERM}]" value="{PERM_VALUE}" type="checkbox" checked="checked" />{PERM}{GROUP}<br /> <!-- END permhave_row --> </td> |
From: Joe S. <joe...@us...> - 2002-05-23 18:43:06
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/templates/en/default In directory usw-pr-cvs1:/tmp/cvs-serv24391/default Modified Files: authorNew.tpl Added Files: groupNew.tpl groupList.tpl permissionList.tpl permissionNew.tpl Log Message: Permission Groups --- NEW FILE: groupNew.tpl --- <!-- groupNew.tpl --> <FORM ACTION="{ACTION_URL}" METHOD=POST> <INPUT TYPE=HIDDEN NAME="group_id" VALUE="{GROUP_ID}"> <TABLE BORDER=0> <TR> <TD>Name</TD> <TD><INPUT TYPE=TEXT NAME=group_name VALUE="{GROUP_NAME}"></TD> </TR> <TR> <TD>Description</TD> <TD><TEXTAREA NAME="description" WRAP=PHYSICAL cols=30 rows=4>{GROUP_DESCRIPTION}</TEXTAREA></TD> </TR> <TR> <TD>Section(s):</TD> <TD> <SELECT SIZE={SIZE} MULTIPLE NAME=section_id_ary[]> <!-- BEGIN section_row --> <OPTION VALUE="{SECTION_ID}" {SELECTED}>{SECTION_NAME}</OPTION> <!-- END section_row --> </SELECT> </TD> </TR> <TR> <TD>Groups:</TD> <TD> <SELECT SIZE={SIZE} MULTIPLE NAME=group_id_ary[]> <!-- BEGIN group_row --> <OPTION VALUE="{CHILDGROUP_ID}" {SELECTED}>{CHILDGROUP_NAME}</OPTION> <!-- END group_row --> </SELECT> </TD> </TR> <TR> <TD>Permissions:</TD> <TD> <SELECT SIZE={SIZEPERMS} MULTIPLE NAME=perm_id_ary[]> <!-- BEGIN permission_row --> <OPTION VALUE="{PERMISSION_ID}" {SELECTED}>{PERMISSION_NAME}</OPTION> <!-- END permission_row --> </SELECT> </TD> </TR> <TR> <TD> </TD> <TD><INPUT TYPE=SUBMIT NAME="submit" VALUE="submit"></TD> </TR> </TABLE> </FORM> <!-- groupNew.tpl --> --- NEW FILE: groupList.tpl --- <!-- groupList.tpl --> <TABLE BORDER=0 CELLPADDING=3> <TR> <TD><b>ID</b></TD> <TD><b>Name</b></TD> <TD><b>Actions</b></TD> </TR> <!-- BEGIN row --> <TR> <TD>{GROUP_ID}</TD> <TD>{GROUP_NAME}</TD> <TD>{ADMIN}</TD> </TR> <!-- END row --> </TABLE> <!-- groupList.tpl --> --- NEW FILE: permissionList.tpl --- <!-- permissionList.tpl --> <TABLE BORDER=0 CELLPADDING=3> <TR> <TD><b>ID</b></TD> <TD><b>Name</b></TD> <TD><b>Actions</b></TD> </TR> <!-- BEGIN row --> <TR> <TD>{PERMISSION_ID}</TD> <TD>{PERMISSION_NAME}</TD> <TD>{ADMIN}</TD> </TR> <!-- END row --> </TABLE> <!-- permissionList.tpl --> --- NEW FILE: permissionNew.tpl --- <!-- permissionNew.tpl --> <FORM ACTION="{ACTION_URL}" METHOD=POST> <INPUT TYPE=HIDDEN NAME="permission_id" VALUE="{PERMISSION_ID}"> <TABLE BORDER=0> <TR> <TD>Name</TD> <TD><INPUT TYPE=TEXT NAME=permission_name VALUE="{PERMISSION_NAME}"></TD> </TR> <TR> <TD>Description</TD> <TD><TEXTAREA NAME="description" WRAP=PHYSICAL cols=30 rows=4>{PERMISSION_DESCRIPTION}</TEXTAREA></TD> </TR> <TR> <TD> </TD> <TD><INPUT TYPE=SUBMIT NAME="submit" VALUE="submitperm"></TD> </TR> </TABLE> </FORM> <!-- permissionNew.tpl --> Index: authorNew.tpl =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/templates/en/default/authorNew.tpl,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** authorNew.tpl 17 Dec 2001 22:45:02 -0000 1.8 --- authorNew.tpl 23 May 2002 18:43:03 -0000 1.9 *************** *** 34,41 **** <TD valign=top> <!-- BEGIN perm_row --> ! <input name="permission[]" value="{PERM}" type=checkbox>{PERM}<br /> <!-- END perm_row --> <!-- BEGIN permhave_row --> ! <input name="permission[]" value="{PERM}" type=checkbox checked="checked">{PERM}<br /> <!-- END permhave_row --> </TD --- 34,41 ---- <TD valign=top> <!-- BEGIN perm_row --> ! <input name="permission[{PERM}]" value="{PERM_VALUE}" type=checkbox>{PERM}{GROUP}<br /> <!-- END perm_row --> <!-- BEGIN permhave_row --> ! <input name="permission[{PERM}]" value="{PERM_VALUE}" type=checkbox checked="checked">{PERM}{GROUP}<br /> <!-- END permhave_row --> </TD |
From: Joe S. <joe...@us...> - 2002-05-23 18:42:02
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory usw-pr-cvs1:/tmp/cvs-serv24043/phpslash-ft/class Modified Files: functions.inc Log Message: Permission Groups Index: functions.inc =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/functions.inc,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** functions.inc 29 Apr 2002 20:52:49 -0000 1.101 --- functions.inc 23 May 2002 18:41:59 -0000 1.102 *************** *** 1053,1056 **** --- 1053,1115 ---- } + /** + * function pslgetAllPerms returns an array of all perms/groups + * + * @access public + * + * @return array perms_ary + */ + function pslgetAllPerms() { + + global $_PSL; + + $db = new slashDB; + + if (empty($_PSL['perm_array'])) { + // static $_PSL['perm_array']; + // debug("pslgetAllPerms", "groups"); + + $q = "SELECT group_name, + group_id + FROM psl_group + ORDER BY group_name"; + $db->query($q); + + while ($db->next_record()) { + $perm_name = $db->f("group_name"); + $_PSL['perm_array'][$perm_name] = $db->f("group_id"); + } + /* + debug("pslgetAllPerms", "sections"); + $q = "SELECT section_id + FROM psl_section + ORDER BY section_name"; + $db->query($q); + */ /* + while ($db->next_record()) { + $perm_name = $db->f("section_id"); + $_PSL['perm_array'][$perm_name] = true; + } + + debug("pslgetAllPerms", "perms"); + $q = "SELECT permission_name + FROM psl_permission + ORDER BY permission_name"; + $db->query($q); + + while ($db->next_record()) { + $perm_name = $db->f("permission_name"); + $_PSL['perm_array'][$perm_name] = true; + } + */ + // debug("pslgetAllPerms::_PSL['perm_array']", $_PSL['perm_array']); + // $sess->register(_PSL['perm_array']); + } else { + // debug("pslgetAllPerms", "already exists"); + } + // debug("pslgetAllPerms::_PSL['perm_array']", $_PSL['perm_array']); + return $_PSL['perm_array']; + } + ?> |
From: Joe S. <joe...@us...> - 2002-05-23 18:41:27
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory usw-pr-cvs1:/tmp/cvs-serv23839/phpslash-ft/class Modified Files: Author.class slashPerm.class slashAuthCR.class Added Files: Group.class Log Message: Permission Groups --- NEW FILE: Group.class --- <?php /* $Id: Group.class,v 1.1 2002/05/23 18:41:24 joestewart Exp $ */ /** * Provides an API to the PHPSlash Group Management. * * This object is how we do manage permission groups. * */ class Group { var $group_templ; /* the template object */ var $db; /* the db object */ var $perm; /* our local version of the perm object */ var $psl; /* our local version of the _PSL array */ var $message; /** * The Group Constructor * * sets up the local version of the global _PSL array, the templates * and a few other things * @access private */ function Group () { global $perm, $_PSL, $amp; $this->db = new slashDB; $this->perm = $perm; $this->psl = $_PSL; /* Templates */ $this->group_templ = new Template($this->psl['templatedir']); $this->group_templ->debug = 0; $this->group_templ->set_file(array( 'listgroup' => "groupList.tpl", 'newgroup' => "groupNew.tpl" )); $this->permission_templ = new Template($this->psl['templatedir']); $this->permission_templ->debug = 0; $this->permission_templ->set_file(array( 'listpermission' => "permissionList.tpl", 'newpermission' => "permissionNew.tpl" )); } /* * METHODS */ /** * listGroup - list all Groups * * displays the complete list of groups * Used only by admin * @access public */ function listGroup() { $q = "SELECT * FROM psl_group ORDER BY group_name"; $this->db->query($q); titlebar("100%","Change existing Groups"); $this->group_templ->set_block("listgroup","row","rows"); while ($this->db->next_record()) { $group_id = $this->db->Record[group_id]; if ($this->perm->have_perm("groupAdmin")) { $admin = "<A HREF=\"" . $this->psl['phpself'] . "?submit=edit" . $this->psl['amp'] . "group_id=$group_id\">[Edit]</A>"; $admin .= " <A HREF=\"" . $this->psl['phpself'] . "?submit=delete" . $this->psl['amp'] . "group_id=$group_id\">[Delete]</A>"; } else { $admin = " <A HREF=\"" . $this->psl['phpself'] . "?submit=delete" . $this->psl['amp'] . "group_id=$group_id\">[Delete]</A>"; } $this->group_templ->set_var(array( 'GROUP_NAME' => $this->db->Record['group_name'], 'GROUP_ID' => $group_id, 'GROUP_DESCRIPTION' => $this->db->Record['group_description'], 'ACTION_URL' => $this->psl['phpself'], 'ADMIN' => $admin )); $this->group_templ->parse("rows","row",true); }; $this->group_templ->parse('OUT',array("listgroup")); $this->group_templ->p('OUT'); } /** * saveGroup - save the group info to the DB * * Saves the group in the $ary array to the DB * Obligatory fields: group_name, image, width, height, alt_text * Optional fields: group_id (only if this group is already in the DB), * onlinkbar (if blank, defaults to 0) * Returns true if sucessful (group added or updated), false on error * Used only by admin * * @param array $ary * * @access public */ function saveGroup($ary) { debug("Group.class::saveGroup::ary", $ary); debug("Group.class::saveGroup::ary['group_id_ary']", $ary['group_id_ary']); /* We don't test for group_id because no group_id means, that this is a new group. */ if ($ary[group_name] == "") { $this->message = "There is no group_name in Group.class::saveGroup"; return false; } if ($ary[description] == "") { $this->message = "There is no description in Group.class::saveGroup"; return false; } $section_id_ary = $ary['section_id_ary']; $perm_id_ary = $ary['perm_id_ary']; $group_id_ary = $ary['group_id_ary']; $ary = clean($ary); /* if a record exists, then we update, else we insert a new group! */ $q = "SELECT group_id FROM psl_group WHERE group_id = '$ary[group_id]'"; $this->db->query($q); if ($this->db->next_record()) { $section_del = "DELETE FROM psl_group_section_lut WHERE group_id='$ary[group_id]'"; // echo "<H3>SECTION_DEL: $section_del</H3>\n"; $this->db->query($section_del); $permission_del = "DELETE FROM psl_group_permission_lut WHERE group_id='$ary[group_id]'"; // echo "<H3>PERMISSION_DEL: $permission_del</H3>\n"; $this->db->query($permission_del); $childgroup_del = "DELETE FROM psl_group_group_lut WHERE group_id='$ary[group_id]'"; // echo "<H3>CHILDGROUP_DEL: $childgroup_del</H3>\n"; $this->db->query($childgroup_del); $q = "UPDATE psl_group SET group_name = '$ary[group_name]', group_description = '$ary[description]' WHERE group_id = '$ary[group_id]'"; $this->message = "Group information updated"; } else { $ary[group_id] = generateID("psl_group_seq"); $q = "INSERT INTO psl_group (group_id, group_name, group_description) VALUES ('$ary[group_id]', '$ary[group_name]', '$ary[description]')"; $this->message = "Group information saved"; } // $section_id_ary = $ary['section_id_ary']; if(is_array($section_id_ary) ) { while ( list( $key, $val ) = each( $section_id_ary ) ) { $lut_id = generateID("psl_group_section_lut_seq"); $lut_insert = "INSERT INTO psl_group_section_lut (lut_id, section_id, group_id) VALUES ('$lut_id', '$val', '$ary[group_id]')"; # echo "<H3>LUT_INSERT: $lut_insert</H3>\n"; $this->db->query($lut_insert); } } else { $this->message = "No section chosen."; $status = false; return $status; } // echo "<BR><B>QUERY: $q</B><BR>\n"; $this->db->query($q); if(is_array($perm_id_ary) ) { while ( list( $key, $val ) = each( $perm_id_ary ) ) { $lut_id = generateID("psl_group_permission_lut_seq"); $lut_insert = "INSERT INTO psl_group_permission_lut (lut_id, permission_id, group_id) VALUES ('$lut_id', '$val', '$ary[group_id]')"; # echo "<H3>LUT_INSERT: $lut_insert</H3>\n"; $this->db->query($lut_insert); } } else { // groups of groups need choose no perms. // $this->message = "No permission chosen."; // $status = false; // return $status; } if(is_array($group_id_ary) ) { while ( list( $key, $val ) = each( $group_id_ary ) ) { $lut_id = generateID("psl_group_group_lut_seq"); $lut_insert = "INSERT INTO psl_group_group_lut (lut_id, group_id, childgroup_id) VALUES ('$lut_id', '$ary[group_id]', '$val')"; echo "<H3>LUT_INSERT: $lut_insert</H3>\n"; $this->db->query($lut_insert); } // } else { // $this->message = "No childgroups chosen."; // $status = false; // return $status; } $status = true; return $status; } /** * deleteGroup - deletes the group info from the db * * Given the group_id, it deletes that from the group table. The * psl_group_lut and psl_group_submission_lut table must be cleaned * first by updating all the stories to point to different groups. It * will also check and make sure there are NO stories/submissions * associated with this group before deleting it. Returns true if * group is deleted, false if not. * * @param integer group_id * * @access public */ function deleteGroup($group_id) { $go_ahead = true; /* go ahead and assume this group should be smoked */ if (!$group_id) { return false; } /* check for any stories that are associated with this group */ /* $q = "SELECT psl_story.title, psl_story.story_id FROM psl_story, psl_group_lut WHERE psl_story.story_id = psl_group_lut.story_id AND psl_group_lut.group_id = '$group_id'"; $this->db->query($q); while ($this->db->next_record()) { $go_ahead = false; $title = $this->db->Record["title"]; $story_id = $this->db->Record["story_id"]; $group_name = $this->db->Record["group_name"]; echo "Sorry, ths story is assigned to this group:"; echo "<font color=\"red\">'$title'</font><br />\n"; } */ /* check for any submissions that are associated with this group */ /* $q = "SELECT psl_submission.title, psl_submission.story_id FROM psl_submission, psl_group_submission_lut WHERE psl_submission.story_id = psl_group_submission_lut.story_id AND psl_group_submission_lut.group_id = '$group_id'"; $this->db->query($q); while ($this->db->next_record()) { $go_ahead = false; $title = $this->db->Record["title"]; $story_id = $this->db->Record["story_id"]; $group_name = $this->db->Record["group_name"]; echo "Sorry, this submission is assigned to this group:"; echo "<font color=\"red\">'$title'</font><br />\n"; } */ if (!$go_ahead) { $this->message = "Group not deleted"; return false; } else { $q = "DELETE FROM psl_group WHERE group_id = '$group_id'"; $this->db->query($q); $this->message = "Group deleted"; return true; } } /** * newGroup - spits out a blank or filled form for input * * Just prints out the "form" and points the user to the "save" method * Used only by admin * * @param array ary * @access public */ function newGroup($ary="") { titlebar("100%","Add a new Group"); $this->group_templ->set_var(array( 'GROUP_ID' => "", 'GROUP_NAME' => "", 'GROUP_DESCRIPTION' => "", 'ACTION_URL' => $this->psl['phpself'] )); $this->group_templ->set_block("newgroup","section_row","section_rows"); $section = new Section; $section_ary = $section->getSections(); $this->group_templ->set_var(array( 'SECTION_ID' => 0, 'SELECTED' => "selected=\"selected\"", 'SECTION_NAME' => pslgetText("All Sections") )); $this->group_templ->parse("section_rows","section_row",true); while ( list( $key, $val ) = each( $section_ary ) ) { // $perms_needed = "newBlock && ".$this->db->Record[section_name]; // if( $this->perm->have_perm($perms_needed)) { $this->group_templ->set_var(array( 'SECTION_ID' => $val['id'], 'SELECTED' => "", 'SECTION_NAME' => $val['name'] )); $this->group_templ->parse("section_rows","section_row",true); $size++; // } } if($size > 5) { $size = 5; } $this->group_templ->set_block("newgroup","group_row","group_rows"); $groups_ary = $this->getGroups(); $size = 0; while ( list( $key, $val ) = each( $groups_ary ) ) { // $perms_needed = "newBlock && ".$this->db->Record[section_name]; // if( $this->perm->have_perm($perms_needed)) { $this->group_templ->set_var(array( 'CHILDGROUP_ID' => $val['id'], 'SELECTED' => "", 'CHILDGROUP_NAME' => $val['name'] )); $this->group_templ->parse("group_rows","group_row",true); $size++; // } } if($size > 5) { $size = 5; } $this->group_templ->set_block("newgroup","permission_row","permission_rows"); $perm_ary = $this->getPermissions(); $size = 0; while ( list( $key, $val ) = each( $perm_ary ) ) { // $perms_needed = "newBlock && ".$this->db->Record[section_name]; // if( $this->perm->have_perm($perms_needed)) { // debug("val[id]", $val[id]); // debug("val[name]", $val['name']); $this->group_templ->set_var(array( 'PERMISSION_ID' => $val['id'], 'SELECTED' => "", 'PERMISSION_NAME' => $val[name] )); $this->group_templ->parse("permission_rows","permission_row",true); $size++; // } } if($size > 5) { $size = 5; } $this->group_templ->set_var("SIZE", $size); $this->group_templ->set_var("SIZEPERMS", $size); $this->group_templ->parse('OUT',array("newgroup")); $this->group_templ->p('OUT'); } /** * editGroup - spits out a blank or filled form for input * * Just prints out the "form" and points the user to the "save" method * Used only by admin * * @param array ary * @access public */ function editGroup($ary="") { titlebar("100%","Edit Group"); $q = "SELECT group_id, group_name, group_description FROM psl_group WHERE group_id = '$ary[group_id]'"; $this->db->query($q); $this->db->next_record(); $this->group_templ->set_var(array( 'GROUP_ID' => $this->db->Record["group_id"], 'GROUP_NAME' => $this->db->Record["group_name"], 'GROUP_DESCRIPTION' => $this->db->Record["group_description"], 'ACTION_URL' => $this->psl['phpself'] )); $this->group_templ->set_block("newgroup","section_row","section_rows"); $section = new Section; $section_ary = $section->getSections(); /* * Get the section_id's for this group into an array */ $q = "SELECT section_id FROM psl_group_section_lut WHERE group_id = '$ary[group_id]' "; // debug("q", $q); $this->db->query($q); $i = 0; while ($this->db->next_record()) { $group_section_ary[$i] = $this->db->Record['section_id']; $i++; } /* * Get the childgroup_id's for this group into an array */ $q = "SELECT childgroup_id FROM psl_group_group_lut WHERE group_id = '$ary[group_id]' "; // debug("q", $q); $this->db->query($q); $i = 0; while ($this->db->next_record()) { $group_group_ary[$i] = $this->db->Record['childgroup_id']; $i++; } /* * Get the permission_id's for this group into an array */ $q = "SELECT permission_id FROM psl_group_permission_lut WHERE group_id = '$ary[group_id]' "; // debug("q", $q); $this->db->query($q); $i = 0; while ($this->db->next_record()) { $group_permission_ary[$i] = $this->db->Record['permission_id']; $i++; } $this->group_templ->set_var(array( 'SECTION_ID' => 0, 'SELECTED' => "", 'SECTION_NAME' => pslgetText("All Sections") )); $this->group_templ->set_var('SELECTED',""); for ($i = 0 ; $i < count($group_section_ary) ; $i++) { if ($group_section_ary[$i] == 0) { $this->group_templ->set_var('SELECTED',"selected=\"selected\""); } } $this->group_templ->parse("section_rows","section_row",true); while ( list( $key, $val ) = each( $section_ary ) ) { // $perms_needed = "newBlock && ".$this->db->Record[section_name]; // if( $this->perm->have_perm($perms_needed)) { $this->group_templ->set_var(array( 'SECTION_ID' => $val['id'], 'SELECTED' => "", 'SECTION_NAME' => $val['name'] )); $this->group_templ->set_var('SELECTED',""); for ($i = 0 ; $i < count($group_section_ary) ; $i++) { if ($group_section_ary[$i] == $val['id']) { $this->group_templ->set_var('SELECTED',"selected=\"selected\""); } } $this->group_templ->parse("section_rows","section_row",true); $size++; // } } if($size > 5) { $size = 5; } $this->group_templ->set_block("newgroup","group_row","group_rows"); $groups_ary = $this->getGroups(); $size = 0; while ( list( $key, $val ) = each( $groups_ary ) ) { // $perms_needed = "newBlock && ".$this->db->Record[section_name]; // if( $this->perm->have_perm($perms_needed)) { $this->group_templ->set_var(array( 'CHILDGROUP_ID' => $val['id'], 'SELECTED' => "", 'CHILDGROUP_NAME' => $val['name'] )); $this->group_templ->set_var('SELECTED',""); for ($i = 0 ; $i < count($group_group_ary) ; $i++) { // debug("val['id']", $val['id']); // debug("group_group_ary[$i]", $group_group_ary[$i]); if ($group_group_ary[$i] == $val['id']) { // debug("good", "deal"); $this->group_templ->set_var('SELECTED',"selected=\"selected\""); } } // no circular references if( $val['id'] != $ary[group_id]) { $this->group_templ->parse("group_rows","group_row",true); } $size++; // } } if($size > 5) { $size = 5; } $this->group_templ->set_block("newgroup","permission_row","permission_rows"); $perm_ary = $this->getPermissions(); $size = 0; while ( list( $key, $val ) = each( $perm_ary ) ) { // $perms_needed = "newBlock && ".$this->db->Record[section_name]; // if( $this->perm->have_perm($perms_needed)) { // debug("val[id]", $val[id]); // debug("val[name]", $val['name']); $this->group_templ->set_var(array( 'PERMISSION_ID' => $val['id'], 'SELECTED' => "", 'PERMISSION_NAME' => $val[name] )); $this->group_templ->set_var('SELECTED',""); for ($i = 0 ; $i < count($group_permission_ary) ; $i++) { // debug("val['id']", $val['id']); // debug("group_permission_ary[$i]", $group_permission_ary[$i]); if ($group_permission_ary[$i] == $val['id']) { // debug("good", "deal"); $this->group_templ->set_var('SELECTED',"selected=\"selected\""); } } $this->group_templ->parse("permission_rows","permission_row",true); $size++; // } } if($size > 5) { $size = 5; } $this->group_templ->set_var("SIZE", $size); $this->group_templ->set_var("SIZEPERMS", $size); $this->group_templ->parse('OUT',array("newgroup")); $this->group_templ->p('OUT'); } /** * getName - return name assign to id * * when given a group id, getName returns the name * * @param integer id * @access public * return author_name */ function getName($id) { if (!$id) { return false; } else { $q = "SELECT group_name FROM psl_group WHERE group_id = '$id'"; $this->db->query($q); $this->db->next_record(); return $this->db->f("group_name"); }; } /** * getId - return id assign to name * * when given a name, getId returns the id * * @param string name * @access public * return group_id */ function getId($name) { if (!$name) { return false; } else { $q = "SELECT group_id FROM psl_group WHERE group_name = '$name'"; $this->db->query($q); $this->db->next_record(); return $this->db->f("group_id"); }; } /** * getGroups - returns array with group ids and names * * * @access public * return group_array(id, name) */ function getGroups() { $q = "SELECT group_id, group_name FROM psl_group ORDER BY group_name"; $this->db->query($q); while ($this->db->next_record()) { $group_array[] = array( "id" => $this->db->f("group_id"), "name" => $this->db->f("group_name") ); } return $group_array; } /** * getMessage - returns text in this->message * * * @access public * return this->message */ function getMessage() { return $this->message; } /** * listPermission - list all Permissions * * displays the complete list of permissions * Used only by admin * @access public */ function listPermission() { $q = "SELECT * FROM psl_permission ORDER BY permission_name"; $this->db->query($q); titlebar("100%","Change existing Permissions"); $this->permission_templ->set_block("listpermission","row","rows"); while ($this->db->next_record()) { $permission_id = $this->db->Record[permission_id]; if ($this->perm->have_perm("permissionAdmin")) { $admin = "<A HREF=\"" . $this->psl['phpself'] . "?submit=editperm" . $this->psl['amp'] . "permission_id=$permission_id\">[Edit]</A>"; $admin .= " <A HREF=\"" . $this->psl['phpself'] . "?submit=deleteperm" . $this->psl['amp'] . "permission_id=$permission_id\">[Delete]</A>"; } else { $admin = " <A HREF=\"" . $this->psl['phpself'] . "?submit=deleteperm" . $this->psl['amp'] . "permission_id=$permission_id\">[Delete]</A>"; } $this->permission_templ->set_var(array( 'PERMISSION_NAME' => $this->db->Record['permission_name'], 'PERMISSION_ID' => $permission_id, 'PERMISSION_DESCRIPTION' => $this->db->Record['permission_description'], 'ACTION_URL' => $this->psl['phpself'], 'ADMIN' => $admin )); $this->permission_templ->parse("rows","row",true); }; $this->permission_templ->parse('OUT',array("listpermission")); $this->permission_templ->p('OUT'); } /** * savePermission - save the permission info to the DB * * Saves the permission in the $ary array to the DB * Obligatory fields: permission_name, image, width, height, alt_text * Optional fields: permission_id (only if this permission is already in the DB), * onlinkbar (if blank, defaults to 0) * Returns true if sucessful (permission added or updated), false on error * Used only by admin * * @param array $ary * * @access public */ function savePermission($ary) { // debug("Permission.class::savePermission::ary", $ary); /* We don't test for permission_id because no permission_id means, that this is a new permission. */ if ($ary[permission_name] == "") { $this->message = "There is no permission_name in Permission.class::savePermission"; return false; } if ($ary[description] == "") { $this->message = "There is no description in Permission.class::savePermission"; return false; } $ary = clean($ary); /* if a record exists, then we update, else we insert a new permission! */ $q = "SELECT permission_id FROM psl_permission WHERE permission_id = '$ary[permission_id]'"; $this->db->query($q); if ($this->db->next_record()) { $q = "UPDATE psl_permission SET permission_name = '$ary[permission_name]', permission_description = '$ary[description]' WHERE permission_id = '$ary[permission_id]'"; $this->message = "Permission information updated"; } else { $ary[permission_id] = generateID("psl_permission_seq"); $q = "INSERT INTO psl_permission (permission_id, permission_name, permission_description) VALUES ('$ary[permission_id]', '$ary[permission_name]', '$ary[description]')"; $this->message = "Permission information saved"; } // echo "<BR><B>QUERY: $q</B><BR>\n"; $this->db->query($q); return true; } /** * deletePermission - deletes the permission info from the db * * Given the permission_id, it deletes that from the permission table. The * psl_permission_lut and psl_permission_submission_lut table must be cleaned * first by updating all the stories to point to different permissions. It * will also check and make sure there are NO stories/submissions * associated with this permission before deleting it. Returns true if * permission is deleted, false if not. * * @param integer permission_id * * @access public */ function deletePermission($permission_id) { $go_ahead = true; /* go ahead and assume this permission should be smoked */ if (!$permission_id) { return false; } /* check for any stories that are associated with this permission */ /* $q = "SELECT psl_story.title, psl_story.story_id FROM psl_story, psl_permission_lut WHERE psl_story.story_id = psl_permission_lut.story_id AND psl_permission_lut.permission_id = '$permission_id'"; $this->db->query($q); while ($this->db->next_record()) { $go_ahead = false; $title = $this->db->Record["title"]; $story_id = $this->db->Record["story_id"]; $permission_name = $this->db->Record["permission_name"]; echo "Sorry, ths story is assigned to this permission:"; echo "<font color=\"red\">'$title'</font><br />\n"; } */ /* check for any submissions that are associated with this permission */ /* $q = "SELECT psl_submission.title, psl_submission.story_id FROM psl_submission, psl_permission_submission_lut WHERE psl_submission.story_id = psl_permission_submission_lut.story_id AND psl_permission_submission_lut.permission_id = '$permission_id'"; $this->db->query($q); while ($this->db->next_record()) { $go_ahead = false; $title = $this->db->Record["title"]; $story_id = $this->db->Record["story_id"]; $permission_name = $this->db->Record["permission_name"]; echo "Sorry, this submission is assigned to this permission:"; echo "<font color=\"red\">'$title'</font><br />\n"; } */ if (!$go_ahead) { $this->message = "Permission not deleted"; return false; } else { $q = "DELETE FROM psl_permission WHERE permission_id = '$permission_id'"; $this->db->query($q); $this->message = "Permission deleted"; return true; } } /** * editPermission - spits out a blank or filled form for input * * Just prints out the "form" and points the user to the "save" method * Used only by admin * * @param array ary * @access public */ function editPermission($ary="") { if($ary["permission_id"] == "") { titlebar("100%","Add a new Permission"); $this->permission_templ->set_var(array( 'PERMISSION_ID' => "", 'PERMISSION_NAME' => "", 'PERMISSION_DESCRIPTION' => "", 'ACTION_URL' => $this->psl['phpself'] )); } else { titlebar("100%","Edit Permission"); $q = "SELECT permission_id, permission_name, permission_description FROM psl_permission WHERE permission_id = '$ary[permission_id]'"; $this->db->query($q); $this->db->next_record(); $this->permission_templ->set_var(array( 'PERMISSION_ID' => $this->db->Record["permission_id"], 'PERMISSION_NAME' => $this->db->Record["permission_name"], 'PERMISSION_DESCRIPTION' => $this->db->Record["permission_description"], 'ACTION_URL' => $this->psl['phpself'] )); } $this->permission_templ->parse('OUT',array("newpermission")); $this->permission_templ->p('OUT'); } /** * getName - return name assign to id * * when given a permission id, getName returns the name * * @param integer id * @access public * return author_name */ function getName($id) { if (!$id) { return false; } else { $q = "SELECT permission_name FROM psl_permission WHERE permission_id = '$id'"; $this->db->query($q); $this->db->next_record(); return $this->db->f("permission_name"); }; } /** * getId - return id assign to name * * when given a name, getId returns the id * * @param string name * @access public * return permission_id */ function getId($name) { if (!$name) { return false; } else { $q = "SELECT permission_id FROM psl_permission WHERE permission_name = '$name'"; $this->db->query($q); $this->db->next_record(); return $this->db->f("permission_id"); }; } /** * getPermissions - returns array with permission ids and names * * * @access public * return permission_array(id, name) */ function getPermissions() { $q = "SELECT permission_id, permission_name FROM psl_permission ORDER BY permission_name"; $this->db->query($q); while ($this->db->next_record()) { $permission_array[] = array( "id" => $this->db->f("permission_id"), "name" => $this->db->f("permission_name") ); } return $permission_array; } } /* end of Group.class */ ?> Index: Author.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Author.class,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Author.class 20 May 2002 19:54:17 -0000 1.19 --- Author.class 23 May 2002 18:41:24 -0000 1.20 *************** *** 133,137 **** WHERE author_id = '".$ary['author_id']."'"); ! $joined_perms = join(',',$ary['permission']); if ($this->db->next_record()) { if ($ary['password'] == "") { --- 133,138 ---- WHERE author_id = '".$ary['author_id']."'"); ! // $joined_perms = join(',',$ary['permission']); ! $joined_perms = ''; if ($this->db->next_record()) { if ($ary['password'] == "") { *************** *** 196,199 **** --- 197,219 ---- $this->message = "Author Created"; } + + if(is_array($ary['permission']) ) { + while ( list( $key, $val ) = each( $ary['permission'] ) ) { + $lut_id = generateID("psl_author_group_lut_seq"); + $lut_insert = "INSERT INTO psl_author_group_lut + (lut_id, + author_id, + group_id) + VALUES ('$lut_id', + '$ary[author_id]', + '$val')"; + # echo "<H3>LUT_INSERT: $lut_insert</H3>\n"; + $this->db->query($lut_insert); + } + } else { + $this->message = "No permissions chosen."; + $status = false; + return $status; + } # echo "<BR><PRE><B>QUERY: $q</B></PRE><BR>\n"; *************** *** 338,346 **** $allperms_ary = $this->perm->getPerms(); ! for( $i=0; $i < count($allperms_ary); $i++) { ! $this->author_templ->set_var( PERM, $allperms_ary[$i]); $this->author_templ->parse("perm_rows","perm_row",true); } ! $this->author_templ->set_var(array( 'ACTION_URL' => $this->psl['phpself'], --- 358,373 ---- $allperms_ary = $this->perm->getPerms(); ! while(list($k, $v) = each($allperms_ary)) { ! if(is_array($v)) { ! $this->author_templ->set_var( PERM_VALUE, $v); ! $this->author_templ->set_var( GROUP, "*"); ! } else { ! $this->author_templ->set_var( PERM_VALUE, $v); ! $this->author_templ->set_var( GROUP, ""); ! } ! $this->author_templ->set_var( PERM, $k); $this->author_templ->parse("perm_rows","perm_row",true); } ! $this->author_templ->set_var(array( 'ACTION_URL' => $this->psl['phpself'], *************** *** 399,417 **** $author_id = $this->db->Record['author_id']; ! $author_perms = $this->db->Record['perms']; $this->author_templ->set_block("newauthor","perm_row","perm_rows"); $this->author_templ->set_block("newauthor","permhave_row","permhave_rows"); ! ! $allperms_ary = $this->perm->getPerms(); ! while(list($k, $v) = each($allperms_ary)) { ! $this->author_templ->set_var( PERM, $v); ! if ($this->perm->perm_islisted($author_perms,$v)) { ! $this->author_templ->parse("perm_rows","permhave_row",true); ! } else { ! $this->author_templ->parse("perm_rows","perm_row",true); ! } ! } ! ! $this->author_templ->set_var(array( 'ACTION_URL' => $this->psl['phpself'], 'AUTHOR_ID' => $author_id, --- 426,434 ---- $author_id = $this->db->Record['author_id']; ! // $author_perms = $this->db->Record['perms']; $this->author_templ->set_block("newauthor","perm_row","perm_rows"); $this->author_templ->set_block("newauthor","permhave_row","permhave_rows"); ! ! $this->author_templ->set_var(array( 'ACTION_URL' => $this->psl['phpself'], 'AUTHOR_ID' => $author_id, *************** *** 426,430 **** 'AMP' => $this->psl['amp'] )); ! }; $this->author_templ->parse('OUT',$template); --- 443,481 ---- 'AMP' => $this->psl['amp'] )); ! ! $allperms_ary = $this->perm->getPerms(); ! /* ! * Get the author_perms's for this author into an array ! */ ! $q = "SELECT psl_group.group_id, ! psl_group.group_name ! FROM psl_group, psl_author_group_lut ! WHERE psl_group.group_id = psl_author_group_lut.group_id ! AND psl_author_group_lut.author_id = '$author_id' "; ! // debug("q", $q); ! $this->db->query($q); ! // $i = 0; ! ! while ($this->db->next_record()) { ! $author_perms[$this->db->Record['group_name']] = $this->db->Record['group_id']; ! // $i++; ! } ! ! while(list($k, $v) = each($allperms_ary)) { ! if(is_array($v)) { ! $this->author_templ->set_var( PERM_VALUE, $v); ! $this->author_templ->set_var( GROUP, "*"); ! } else { ! $this->author_templ->set_var( PERM_VALUE, $v); ! $this->author_templ->set_var( GROUP, ""); ! } ! $this->author_templ->set_var( PERM, $k); ! if ($this->perm->perm_islisted($author_perms,$k)) { ! $this->author_templ->parse("perm_rows","permhave_row",true); ! } else { ! $this->author_templ->parse("perm_rows","perm_row",true); ! } ! } ! } $this->author_templ->parse('OUT',$template); Index: slashPerm.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/slashPerm.class,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** slashPerm.class 3 Feb 2002 02:49:40 -0000 1.4 --- slashPerm.class 23 May 2002 18:41:24 -0000 1.5 *************** *** 13,17 **** var $classname = "slashPerm"; var $permissions; ! /** * --- 13,18 ---- var $classname = "slashPerm"; var $permissions; ! var $auth; ! /** * *************** *** 22,29 **** function slashPerm() { ! global $_PSL; $this->permissions = $_PSL['perm_array']; ! } --- 23,30 ---- function slashPerm() { ! global $_PSL, $auth; $this->permissions = $_PSL['perm_array']; ! $this->auth = $auth; } *************** *** 38,45 **** * */ ! function perm_sel($name, $current = "", $class = "") { reset($this->permissions); ! $ret = sprintf("<select size=5 multiple name=\"%s[]\"%s>\n", $name, ($class!="")?" class=$class":""); --- 39,46 ---- * */ ! function perm_sel($name, $current = "", $class = "", $size=5) { reset($this->permissions); ! $ret = sprintf("<select size=$size multiple name=\"%s[]\"%s>\n", $name, ($class!="")?" class=$class":""); *************** *** 60,68 **** */ function getPerms() { reset($this->permissions); ! while(list($k, $v) = each($this->permissions)) { ! $ret[] .= $k; } - return $ret; } --- 61,160 ---- */ function getPerms() { + if(is_array($this->permissions)) { + reset($this->permissions); + } + // if(!count($this->permissions) > 0) { + $this->permissions = pslgetAllPerms(); + // } + return $this->permissions; + } + + /** + * getPerm just returns the value stored in the perm array + * + */ + function getPerm($k) { reset($this->permissions); ! return $this->permissions[$k]; ! } ! ! function have_perm($p, $ary='') { ! ! // this->auth creates a copy that stays in memory. ! global $auth; ! ! if (! isset($auth->auth['perm']) ) { ! $auth->auth['perm'] = ""; ! } ! if( !is_array($ary)) { ! $ary = $auth->auth['perm']; ! } ! // boolean OR ! $po_ary = split( "\|{2}", $p); ! $j = 0; ! while( $j < count($po_ary)) { ! // boolean AND ! $p_ary = split( ",|&{2}", $po_ary[0]); ! $i = 0; ! $status = true; ! $max = count($p_ary); ! while( $i < $max) { ! if( is_array($ary)) { ! reset($ary); ! } ! $k = trim($p_ary[$i]); ! if( !$ary[$k]) { ! $status = false; ! $i = $max; ! } ! $i++; ! } ! if(!empty($status)) { ! return true; ! } elseif(is_array($ary)) { ! while(list($k, $v) = each($ary)) { ! if(is_array($ary[$k])) { ! if($this->have_perm($p, $v)) { ! return true; ! } ! } ! } ! } ! $j++; ! } ! return false; ! } ! /* ! function have_perm($p, $ary='') { ! if (! isset($this->auth->auth['perm']) ) { ! $this->auth->auth['perm'] = ""; ! } ! if( !is_array($ary)) { ! $ary = $this->auth->auth['perm']; ! } ! if(!empty($ary[$p])) { ! return true; ! } elseif(is_array($ary)) { ! while(list($k, $v) = each($ary)) { ! if(is_array($ary[$k])) { ! if($this->have_perm($p, $v)) { ! return true; ! } ! } ! } ! // debug("false1" , $p); ! return false; ! } else { ! // debug("false2" , $p); ! return false; ! } ! } ! */ ! function perm_islisted($perms_ary, $look_for) { ! if (isset($perms_ary[$look_for]) ) { ! return true; ! } else { ! return false; } } Index: slashAuthCR.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/slashAuthCR.class,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** slashAuthCR.class 21 May 2002 15:02:04 -0000 1.10 --- slashAuthCR.class 23 May 2002 18:41:24 -0000 1.11 *************** *** 194,198 **** return false; } else { ! $this->auth["perm"] = $this->db->Record["perms"]; if(isset($setcookie)){ $cookie_challenge = md5($this->magic .":". $this->psl['basedir']); --- 194,284 ---- return false; } else { ! // may need to get legacy records ! // $this->auth["perm"] = $this->db->Record["perms"]; ! /* ! * Get the group perms's for this author into an array ! */ ! $q = "SELECT psl_permission.permission_name, ! psl_group.group_name, ! psl_group.group_id ! FROM psl_group, ! psl_author_group_lut, ! psl_group_permission_lut, ! psl_permission ! WHERE psl_group.group_id = psl_author_group_lut.group_id ! AND psl_group.group_id = psl_group_permission_lut.group_id ! AND psl_group_permission_lut.permission_id = psl_permission.permission_id ! AND psl_author_group_lut.author_id = '$uid' "; ! // debug("q", $q); ! $this->db->query($q); ! ! while ($this->db->next_record()) { ! $group_id = $this->db->Record[group_id]; ! $this->auth["perm"][$this->db->Record['group_name']][$this->db->Record['permission_name']] = true; ! $q = "SELECT section_id ! FROM psl_group_section_lut ! WHERE group_id = '$group_id' "; ! $db2 = new slashDB; ! // debug("q", $q); ! $db2->query($q); ! while ($db2->next_record()) { ! $this->auth["perm"][$this->db->Record['group_name']][$db2->Record['section_id']] = true; ! } ! ! ! } ! ! /* ! * Get the group->group perm's for this author into an array ! */ ! ! // first get all the group names in an array ! $q = "SELECT group_name, ! group_id ! FROM psl_group "; ! // debug("q", $q); ! $this->db->query($q); ! ! while ($this->db->next_record()) { ! $groups_ary[$this->db->Record['group_id']] = $this->db->Record['group_name']; ! } ! ! $q = "SELECT psl_group_group_lut.group_id, ! psl_group_group_lut.childgroup_id ! FROM psl_author_group_lut, ! psl_group_group_lut ! WHERE psl_group_group_lut.group_id = psl_author_group_lut.group_id ! AND psl_author_group_lut.author_id = '$uid' "; ! // debug("q", $q); ! $this->db->query($q); ! ! while ($this->db->next_record()) { ! $group_id = $this->db->Record['group_id']; ! $childgroup_id = $this->db->Record['childgroup_id']; ! ! $group_name = $groups_ary[$group_id]; ! $childgroup_name = $groups_ary[$childgroup_id]; ! ! if( is_array($this->auth['perm'][$childgroup_name])) { ! $this->auth['perm'][$group_name][$childgroup_name] = $this->auth['perm'][$childgroup_name]; ! } else { ! // query to get group perms ! $q = "SELECT psl_permission.permission_name ! FROM psl_group_permission_lut, ! psl_permission ! WHERE psl_group_permission_lut.permission_id = psl_permission.permission_id ! AND psl_group_permission_lut.group_id = '$childgroup_id' "; ! // debug("q", $q); ! $db2 = new slashDB; ! $db2->query($q); ! ! while ($db2->next_record()) { ! $this->auth['perm'][$group_name][$childgroup_name][$db2->Record['permission_name']] = true; ! } ! ! } ! ! } ! if(isset($setcookie)){ $cookie_challenge = md5($this->magic .":". $this->psl['basedir']); |
From: Joe S. <joe...@us...> - 2002-05-23 18:41:27
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/admin In directory usw-pr-cvs1:/tmp/cvs-serv23839/phpslash-ft/public_html/admin Added Files: groupAdmin.php3 Log Message: Permission Groups --- NEW FILE: groupAdmin.php3 --- <?php /* $Id: groupAdmin.php3,v 1.1 2002/05/23 18:41:24 joestewart Exp $ */ $pagetitle = "Group Administration"; // header title $xsiteobject = "Administration"; // Defines The META TAG Page Type require("config.php3"); page_open(array("sess"=>"slashSess","auth"=>"slashAuth","perm"=>"slashPerm")); /***************************** START OF PAGE *****************************/ slashhead($pagetitle,$xsiteobject); /* DEBUG */ debug("HTTP_POST_VARS", $HTTP_POST_VARS); debug("HTTP_GET_VARS", $HTTP_GET_VARS); debug("group_name", $group_name); debug("group_description", $group_description); /* DEBUG */ $group = new Group; if ($perm->have_perm("groupAdmin")) { switch ($submit) { case "delete": $success = $group->deleteGroup($group_id); if($success) { echo message( pslgetText($group->getMessage())); } else { error( pslgetText($group->getMessage())); } $group->newGroup(); $group->listGroup(); $group->editPermission(); $group->listPermission(); break; case "submit": $success = $group->saveGroup($HTTP_POST_VARS); if($success) { echo message( pslgetText($group->getMessage())); } else { error( pslgetText($group->getMessage())); } $group->newGroup(); $group->listGroup(); $group->editPermission(); $group->listPermission(); break; case "edit": $ary["group_id"] = $HTTP_GET_VARS['group_id']; debug("ary[group_id]", $ary["group_id"]); $group->editGroup($ary); $group->listGroup(); break; case "deleteperm": $success = $group->deletePermission($permission_id); if($success) { echo message( pslgetText($group->getMessage())); } else { error( pslgetText($group->getMessage())); } $group->newGroup(); $group->listGroup(); $group->editPermission(); $group->listPermission(); break; case "submitperm": $success = $group->savePermission($HTTP_POST_VARS); if($success) { echo message( pslgetText($group->getMessage())); } else { error( pslgetText($group->getMessage())); } $group->newGroup(); $group->listGroup(); $group->editPermission(); $group->listPermission(); break; case "editperm": $ary["permission_id"] = $HTTP_GET_VARS['permission_id']; // debug("ary[permission_id]", $ary["permission_id"]); $group->editPermission($ary); $group->newGroup(); $group->listGroup(); $group->listPermission(); break; default: $group->newGroup(); $group->listGroup(); $group->editPermission(); $group->listPermission(); } } else { titlebar("100%","Error! Invalid Privileges"); echo "Sorry. You do not have the necessary privilege to view this page."; } slashfoot(); page_close(); ?> |
From: Joe S. <joe...@us...> - 2002-05-23 18:41:27
|
Update of /cvsroot/phpslash/phpslash-ft In directory usw-pr-cvs1:/tmp/cvs-serv23839/phpslash-ft Modified Files: CHANGES Log Message: Permission Groups Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.492 retrieving revision 1.493 diff -C2 -d -r1.492 -r1.493 *** CHANGES 21 May 2002 20:07:23 -0000 1.492 --- CHANGES 23 May 2002 18:41:24 -0000 1.493 *************** *** 13,16 **** --- 13,24 ---- 9 - Removal of something (kill -9 :) + 2002-May-23 1:00PM CDT Joe Stewart <joe...@us...> + [EST] - Experimental Permission Groups for testing. Affected files: + slash-all.sql, 65_to_7.sql, config.php3, Group.class, functions.inc, + slashAuthCR.class, slashPerm.class, Author.class. New or changed + templates: authorNew.tpl, groupNew.tpl, groupList.tpl, + permissionNew.tpl, and permissionList.tpl. + [D] - phpslash.sgml - Beginnings of Author and Group documentation. + 2002-May-21 3:00PM CDT Joe Stewart <joe...@us...> [B] - profile.php3 - message output fixed. |
From: Joe S. <joe...@us...> - 2002-05-23 18:38:57
|
Update of /cvsroot/phpslash/phpslash-ft/public_html In directory usw-pr-cvs1:/tmp/cvs-serv22933/phpslash-ft/public_html Modified Files: config.php3 Log Message: Permission Groups Index: config.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/config.php3,v retrieving revision 1.140 retrieving revision 1.141 diff -C2 -d -r1.140 -r1.141 *** config.php3 21 May 2002 15:02:03 -0000 1.140 --- config.php3 23 May 2002 18:38:54 -0000 1.141 *************** *** 99,102 **** --- 99,103 ---- $_PSL['module']['Author'] = true; $_PSL['module']['Variable'] = false; + $_PSL['module']['Group'] = true; $_PSL['show_admin_on_navbar'] = true; // turns the Admin link on in the navbar *************** *** 371,374 **** --- 372,381 ---- 'module' => "Infolog" ); + $menuitem[] = array( + 'name' => "Group", + 'link' => $_PSL['adminurl'] . "/groupAdmin.php3", + 'perm' => "groupAdmin", + 'module' => "Group" + ); $_PSL['menuitem'] = $menuitem; // add default menuitems to global array *************** *** 391,394 **** --- 398,402 ---- // 2.2) PHPLIB Perm Class extension + /* $_PSL['perm_array'] = array( "nobody" => 2, *************** *** 409,413 **** "root" => 2147483648 ); ! // 2.3) PHPSlash<->phplib interface classes require($_PSL['classdir'] . "/slashDB.class"); --- 417,421 ---- "root" => 2147483648 ); ! */ // 2.3) PHPSlash<->phplib interface classes require($_PSL['classdir'] . "/slashDB.class"); *************** *** 469,472 **** --- 477,483 ---- if ($_PSL['module']['Variable']) { require($_PSL['classdir'] . "/Variable.class"); + } + if ($_PSL['module']['Group']) { + require($_PSL['classdir'] . "/Group.class"); } |
From: Joe S. <joe...@us...> - 2002-05-23 18:38:56
|
Update of /cvsroot/phpslash/phpslash-ft/tables/0.7 In directory usw-pr-cvs1:/tmp/cvs-serv22933/phpslash-ft/tables/0.7 Added Files: 65_to_7.sql slash-all.sql Log Message: Permission Groups --- NEW FILE: 65_to_7.sql --- # ALTER TABLE psl_story ADD story_options TEXT; # ALTER TABLE psl_section ADD section_options TEXT; # ALTER TABLE psl_author ADD author_options TEXT; INSERT INTO db_sequence VALUES ('psl_permission_seq',80); INSERT INTO db_sequence VALUES ('psl_group_seq',27); INSERT INTO db_sequence VALUES ('psl_group_section_lut_seq',66); INSERT INTO db_sequence VALUES ('psl_group_permission_lut_seq',109); INSERT INTO db_sequence VALUES ('psl_group_group_lut_seq',64); INSERT INTO db_sequence VALUES ('psl_author_group_lut_seq',26); # # Table structure for table 'psl_group' # CREATE TABLE psl_group ( group_id int(10) unsigned NOT NULL default '0', group_name varchar(60) NOT NULL default '', group_description text, PRIMARY KEY (group_id), UNIQUE KEY group_name (group_name) ) TYPE=MyISAM; # # Dumping data for table 'psl_group' # INSERT INTO psl_group VALUES (1,'author','administer site authors'); INSERT INTO psl_group VALUES (27,'PublicUserAccount','logged in Public User Account'); INSERT INTO psl_group VALUES (4,'block','Block Admin'); INSERT INTO psl_group VALUES (8,'comment','Comment Admin'); INSERT INTO psl_group VALUES (9,'glossary','Glossary Admin'); INSERT INTO psl_group VALUES (10,'groupAdmin','Group Admin'); INSERT INTO psl_group VALUES (11,'infolog','Infolog Admin'); INSERT INTO psl_group VALUES (12,'mailinglist','Mailing List Admin'); INSERT INTO psl_group VALUES (13,'permissionAdmin','Permission Admin'); INSERT INTO psl_group VALUES (14,'poll','Poll Admin'); INSERT INTO psl_group VALUES (15,'section','Section Admin'); INSERT INTO psl_group VALUES (16,'story','Story Admin'); INSERT INTO psl_group VALUES (17,'submission','Submission Admin'); INSERT INTO psl_group VALUES (18,'topic','Topic Admin'); INSERT INTO psl_group VALUES (19,'variable','Variable Admin'); INSERT INTO psl_group VALUES (20,'nobody','Anon user (not effective)'); INSERT INTO psl_group VALUES (21,'user','logged in user privileges. General users.'); INSERT INTO psl_group VALUES (22,'commentUser','User comment privileges'); INSERT INTO psl_group VALUES (23,'storyeditor','Special extend story editor privileges'); INSERT INTO psl_group VALUES (24,'root','All privileges'); INSERT INTO psl_group VALUES (25,'siteeditor','Site Editor'); # # Table structure for table 'psl_group_group_lut' # CREATE TABLE psl_group_group_lut ( lut_id int(11) unsigned NOT NULL default '0', group_id int(11) unsigned default NULL, childgroup_id int(11) unsigned default NULL, UNIQUE KEY lut_id_2 (lut_id), KEY lut_id (lut_id) ) TYPE=MyISAM; # # Dumping data for table 'psl_group_group_lut' # INSERT INTO psl_group_group_lut VALUES (5,2,1); INSERT INTO psl_group_group_lut VALUES (6,27,20); INSERT INTO psl_group_group_lut VALUES (7,27,21); INSERT INTO psl_group_group_lut VALUES (64,24,19); INSERT INTO psl_group_group_lut VALUES (63,24,21); INSERT INTO psl_group_group_lut VALUES (62,24,18); INSERT INTO psl_group_group_lut VALUES (61,24,17); INSERT INTO psl_group_group_lut VALUES (60,24,23); INSERT INTO psl_group_group_lut VALUES (59,24,16); INSERT INTO psl_group_group_lut VALUES (58,24,25); INSERT INTO psl_group_group_lut VALUES (57,24,15); INSERT INTO psl_group_group_lut VALUES (56,24,14); INSERT INTO psl_group_group_lut VALUES (55,24,13); INSERT INTO psl_group_group_lut VALUES (54,24,20); INSERT INTO psl_group_group_lut VALUES (53,24,12); INSERT INTO psl_group_group_lut VALUES (52,24,11); INSERT INTO psl_group_group_lut VALUES (51,24,10); INSERT INTO psl_group_group_lut VALUES (50,24,9); INSERT INTO psl_group_group_lut VALUES (49,24,22); INSERT INTO psl_group_group_lut VALUES (48,24,8); INSERT INTO psl_group_group_lut VALUES (47,24,4); INSERT INTO psl_group_group_lut VALUES (46,24,1); # # Table structure for table 'psl_group_permission_lut' # CREATE TABLE psl_group_permission_lut ( lut_id int(11) unsigned NOT NULL default '0', group_id int(11) unsigned default NULL, permission_id int(11) unsigned default NULL, UNIQUE KEY lut_id_2 (lut_id), KEY lut_id (lut_id) ) TYPE=MyISAM; # # Dumping data for table 'psl_group_permission_lut' # INSERT INTO psl_group_permission_lut VALUES (10,1,50); INSERT INTO psl_group_permission_lut VALUES (9,1,47); INSERT INTO psl_group_permission_lut VALUES (8,1,49); INSERT INTO psl_group_permission_lut VALUES (7,1,48); INSERT INTO psl_group_permission_lut VALUES (6,1,45); INSERT INTO psl_group_permission_lut VALUES (11,1,46); INSERT INTO psl_group_permission_lut VALUES (19,2,49); INSERT INTO psl_group_permission_lut VALUES (20,4,35); INSERT INTO psl_group_permission_lut VALUES (21,4,38); INSERT INTO psl_group_permission_lut VALUES (22,4,39); INSERT INTO psl_group_permission_lut VALUES (23,4,37); INSERT INTO psl_group_permission_lut VALUES (24,4,36); INSERT INTO psl_group_permission_lut VALUES (25,8,7); INSERT INTO psl_group_permission_lut VALUES (26,8,9); INSERT INTO psl_group_permission_lut VALUES (27,8,4); INSERT INTO psl_group_permission_lut VALUES (28,8,6); INSERT INTO psl_group_permission_lut VALUES (29,8,3); INSERT INTO psl_group_permission_lut VALUES (30,8,8); INSERT INTO psl_group_permission_lut VALUES (31,8,5); INSERT INTO psl_group_permission_lut VALUES (32,9,56); INSERT INTO psl_group_permission_lut VALUES (33,9,59); INSERT INTO psl_group_permission_lut VALUES (34,9,60); INSERT INTO psl_group_permission_lut VALUES (35,9,58); INSERT INTO psl_group_permission_lut VALUES (36,9,57); INSERT INTO psl_group_permission_lut VALUES (37,10,20); INSERT INTO psl_group_permission_lut VALUES (38,10,23); INSERT INTO psl_group_permission_lut VALUES (39,10,24); INSERT INTO psl_group_permission_lut VALUES (40,10,22); INSERT INTO psl_group_permission_lut VALUES (41,10,21); INSERT INTO psl_group_permission_lut VALUES (42,11,66); INSERT INTO psl_group_permission_lut VALUES (43,11,69); INSERT INTO psl_group_permission_lut VALUES (44,11,70); INSERT INTO psl_group_permission_lut VALUES (45,11,68); INSERT INTO psl_group_permission_lut VALUES (46,11,67); INSERT INTO psl_group_permission_lut VALUES (47,12,61); INSERT INTO psl_group_permission_lut VALUES (48,12,64); INSERT INTO psl_group_permission_lut VALUES (49,12,65); INSERT INTO psl_group_permission_lut VALUES (50,12,63); INSERT INTO psl_group_permission_lut VALUES (51,12,62); INSERT INTO psl_group_permission_lut VALUES (52,13,25); INSERT INTO psl_group_permission_lut VALUES (53,13,28); INSERT INTO psl_group_permission_lut VALUES (54,13,29); INSERT INTO psl_group_permission_lut VALUES (55,13,27); INSERT INTO psl_group_permission_lut VALUES (56,13,26); INSERT INTO psl_group_permission_lut VALUES (57,14,40); INSERT INTO psl_group_permission_lut VALUES (58,14,43); INSERT INTO psl_group_permission_lut VALUES (59,14,44); INSERT INTO psl_group_permission_lut VALUES (60,14,42); INSERT INTO psl_group_permission_lut VALUES (61,14,41); INSERT INTO psl_group_permission_lut VALUES (62,15,30); INSERT INTO psl_group_permission_lut VALUES (63,15,33); INSERT INTO psl_group_permission_lut VALUES (64,15,34); INSERT INTO psl_group_permission_lut VALUES (65,15,32); INSERT INTO psl_group_permission_lut VALUES (66,15,31); INSERT INTO psl_group_permission_lut VALUES (67,16,78); INSERT INTO psl_group_permission_lut VALUES (68,16,77); INSERT INTO psl_group_permission_lut VALUES (69,16,71); INSERT INTO psl_group_permission_lut VALUES (70,16,79); INSERT INTO psl_group_permission_lut VALUES (71,16,74); INSERT INTO psl_group_permission_lut VALUES (72,16,76); INSERT INTO psl_group_permission_lut VALUES (73,16,75); INSERT INTO psl_group_permission_lut VALUES (74,16,80); INSERT INTO psl_group_permission_lut VALUES (75,16,73); INSERT INTO psl_group_permission_lut VALUES (76,16,72); INSERT INTO psl_group_permission_lut VALUES (77,17,10); INSERT INTO psl_group_permission_lut VALUES (78,17,13); INSERT INTO psl_group_permission_lut VALUES (79,17,14); INSERT INTO psl_group_permission_lut VALUES (80,17,12); INSERT INTO psl_group_permission_lut VALUES (81,17,11); INSERT INTO psl_group_permission_lut VALUES (82,18,15); INSERT INTO psl_group_permission_lut VALUES (83,18,18); INSERT INTO psl_group_permission_lut VALUES (84,18,19); INSERT INTO psl_group_permission_lut VALUES (85,18,17); INSERT INTO psl_group_permission_lut VALUES (86,18,16); INSERT INTO psl_group_permission_lut VALUES (87,19,51); INSERT INTO psl_group_permission_lut VALUES (88,19,54); INSERT INTO psl_group_permission_lut VALUES (89,19,55); INSERT INTO psl_group_permission_lut VALUES (90,19,53); INSERT INTO psl_group_permission_lut VALUES (91,19,52); INSERT INTO psl_group_permission_lut VALUES (92,20,4); INSERT INTO psl_group_permission_lut VALUES (93,20,6); INSERT INTO psl_group_permission_lut VALUES (94,20,3); INSERT INTO psl_group_permission_lut VALUES (95,20,5); INSERT INTO psl_group_permission_lut VALUES (96,21,4); INSERT INTO psl_group_permission_lut VALUES (97,21,6); INSERT INTO psl_group_permission_lut VALUES (98,21,3); INSERT INTO psl_group_permission_lut VALUES (99,21,5); INSERT INTO psl_group_permission_lut VALUES (100,22,4); INSERT INTO psl_group_permission_lut VALUES (101,22,6); INSERT INTO psl_group_permission_lut VALUES (102,22,3); INSERT INTO psl_group_permission_lut VALUES (103,22,5); INSERT INTO psl_group_permission_lut VALUES (104,23,78); INSERT INTO psl_group_permission_lut VALUES (105,23,77); INSERT INTO psl_group_permission_lut VALUES (106,23,79); INSERT INTO psl_group_permission_lut VALUES (107,23,76); INSERT INTO psl_group_permission_lut VALUES (108,23,80); # # Table structure for table 'psl_group_section_lut' # CREATE TABLE psl_group_section_lut ( lut_id int(11) unsigned NOT NULL default '0', group_id int(11) unsigned default NULL, section_id int(11) unsigned default NULL, UNIQUE KEY lut_id_2 (lut_id), KEY lut_id (lut_id) ) TYPE=MyISAM; # # Dumping data for table 'psl_group_section_lut' # INSERT INTO psl_group_section_lut VALUES (17,1,4); INSERT INTO psl_group_section_lut VALUES (16,1,3); INSERT INTO psl_group_section_lut VALUES (15,1,5); INSERT INTO psl_group_section_lut VALUES (14,1,8); INSERT INTO psl_group_section_lut VALUES (39,2,4); INSERT INTO psl_group_section_lut VALUES (19,3,0); INSERT INTO psl_group_section_lut VALUES (38,2,3); INSERT INTO psl_group_section_lut VALUES (37,2,5); INSERT INTO psl_group_section_lut VALUES (40,4,0); INSERT INTO psl_group_section_lut VALUES (41,5,0); INSERT INTO psl_group_section_lut VALUES (42,6,0); INSERT INTO psl_group_section_lut VALUES (43,7,0); INSERT INTO psl_group_section_lut VALUES (44,8,0); INSERT INTO psl_group_section_lut VALUES (45,9,0); INSERT INTO psl_group_section_lut VALUES (46,10,0); INSERT INTO psl_group_section_lut VALUES (47,11,0); INSERT INTO psl_group_section_lut VALUES (48,12,0); INSERT INTO psl_group_section_lut VALUES (49,13,0); INSERT INTO psl_group_section_lut VALUES (50,14,0); INSERT INTO psl_group_section_lut VALUES (51,15,0); INSERT INTO psl_group_section_lut VALUES (52,16,0); INSERT INTO psl_group_section_lut VALUES (53,17,0); INSERT INTO psl_group_section_lut VALUES (54,18,0); INSERT INTO psl_group_section_lut VALUES (55,19,0); INSERT INTO psl_group_section_lut VALUES (56,20,0); INSERT INTO psl_group_section_lut VALUES (57,21,0); INSERT INTO psl_group_section_lut VALUES (58,22,0); INSERT INTO psl_group_section_lut VALUES (59,23,0); INSERT INTO psl_group_section_lut VALUES (66,24,0); INSERT INTO psl_group_section_lut VALUES (61,25,0); INSERT INTO psl_group_section_lut VALUES (62,26,0); INSERT INTO psl_group_section_lut VALUES (63,27,0); # # Table structure for table 'psl_permission' # CREATE TABLE psl_permission ( permission_id int(10) unsigned NOT NULL default '0', permission_name varchar(60) NOT NULL default '', permission_description text, PRIMARY KEY (permission_id), UNIQUE KEY permission_name (permission_name) ) TYPE=MyISAM; # # Dumping data for table 'psl_permission' # INSERT INTO psl_permission VALUES (3,'commentShow','can see comments'); INSERT INTO psl_permission VALUES (4,'commentPost','can post comments'); INSERT INTO psl_permission VALUES (5,'commentView','can preview? comments?'); INSERT INTO psl_permission VALUES (6,'commentSave','can edit comments?'); INSERT INTO psl_permission VALUES (7,'commentDelete','can delete comments'); INSERT INTO psl_permission VALUES (8,'commentUpdate','can moderate comments'); INSERT INTO psl_permission VALUES (9,'commentEdit','can edit comments'); INSERT INTO psl_permission VALUES (10,'submissionDelete','can delete submissions'); INSERT INTO psl_permission VALUES (11,'submissionSave','can save submissions'); INSERT INTO psl_permission VALUES (12,'submissionNew','can submit a story'); INSERT INTO psl_permission VALUES (13,'submissionEdit','can edit submissions'); INSERT INTO psl_permission VALUES (14,'submissioneditasstory','can post submissions as stories'); INSERT INTO psl_permission VALUES (15,'topicDelete','can delete topics'); INSERT INTO psl_permission VALUES (16,'topicSave','can save topics'); INSERT INTO psl_permission VALUES (17,'topicNew','can create new topics'); INSERT INTO psl_permission VALUES (18,'topicEdit','can update topics'); INSERT INTO psl_permission VALUES (19,'topicList','get lists of topics'); INSERT INTO psl_permission VALUES (20,'groupDelete','can delete groups'); INSERT INTO psl_permission VALUES (21,'groupSave','can save groups'); INSERT INTO psl_permission VALUES (22,'groupNew','can create groups'); INSERT INTO psl_permission VALUES (23,'groupEdit','can edit groups'); INSERT INTO psl_permission VALUES (24,'groupList','can list groups'); INSERT INTO psl_permission VALUES (25,'permissionDelete','can delete permissions'); INSERT INTO psl_permission VALUES (26,'permissionSave','can save permissions'); INSERT INTO psl_permission VALUES (27,'permissionNew','can create permissions'); INSERT INTO psl_permission VALUES (28,'permissionEdit','can edit permissions'); INSERT INTO psl_permission VALUES (29,'permissionList','can list permissions'); INSERT INTO psl_permission VALUES (30,'sectionDelete','delete sections'); INSERT INTO psl_permission VALUES (31,'sectionSave','save sections'); INSERT INTO psl_permission VALUES (32,'sectionNew','create sections'); INSERT INTO psl_permission VALUES (33,'sectionEdit','update sections'); INSERT INTO psl_permission VALUES (34,'sectionList','list sections'); INSERT INTO psl_permission VALUES (35,'blockDelete','delete blocks'); INSERT INTO psl_permission VALUES (36,'blockPut','save blocks'); INSERT INTO psl_permission VALUES (37,'blockNew','create blocks'); INSERT INTO psl_permission VALUES (38,'blockEdit','update a block'); INSERT INTO psl_permission VALUES (39,'blockList','list all blocks'); INSERT INTO psl_permission VALUES (40,'pollDelete','delete polls'); INSERT INTO psl_permission VALUES (41,'pollPut','save a poll'); INSERT INTO psl_permission VALUES (42,'pollNew','create a poll'); INSERT INTO psl_permission VALUES (43,'pollEdit','edit polls'); INSERT INTO psl_permission VALUES (44,'pollList','list all polls'); INSERT INTO psl_permission VALUES (45,'authorDelete','delete a user'); INSERT INTO psl_permission VALUES (46,'authorSave','save user info'); INSERT INTO psl_permission VALUES (47,'authorNew','create a user'); INSERT INTO psl_permission VALUES (48,'authorEdit','update user info'); INSERT INTO psl_permission VALUES (49,'authorList','list all authors'); INSERT INTO psl_permission VALUES (50,'authorprofileSave','update your own info'); INSERT INTO psl_permission VALUES (51,'variableDelete','delete a Variable'); INSERT INTO psl_permission VALUES (52,'variableSave','save a variable'); INSERT INTO psl_permission VALUES (53,'variableNew','create a variable'); INSERT INTO psl_permission VALUES (54,'variableEdit','edit a variable'); INSERT INTO psl_permission VALUES (55,'variableList','list all variables'); INSERT INTO psl_permission VALUES (56,'glossaryDelete','delete a glossary entry'); INSERT INTO psl_permission VALUES (57,'glossarySave','save a glossary entry'); INSERT INTO psl_permission VALUES (58,'glossaryNew','create a glossary entry'); INSERT INTO psl_permission VALUES (59,'glossaryEdit','update a glossary entry'); INSERT INTO psl_permission VALUES (60,'glossaryList','list all glossary entries'); INSERT INTO psl_permission VALUES (61,'mailinglistDelete','delete a list member'); INSERT INTO psl_permission VALUES (62,'mailinglistSave','save list member address'); INSERT INTO psl_permission VALUES (63,'mailinglistNew','new member form'); INSERT INTO psl_permission VALUES (64,'mailinglistEdit','update form'); INSERT INTO psl_permission VALUES (65,'mailinglistList','list all members'); INSERT INTO psl_permission VALUES (66,'infologDelete','delete a log entry'); INSERT INTO psl_permission VALUES (67,'infologSave','save a log entry'); INSERT INTO psl_permission VALUES (68,'infologNew','create a log entry'); INSERT INTO psl_permission VALUES (69,'infologEdit','change a log entry?'); INSERT INTO psl_permission VALUES (70,'infologList','display the infolog'); INSERT INTO psl_permission VALUES (71,'storyDelete','delete a story'); INSERT INTO psl_permission VALUES (72,'storySave','save a story'); INSERT INTO psl_permission VALUES (73,'storyNew','new story form'); INSERT INTO psl_permission VALUES (74,'storyEdit','edit story form'); INSERT INTO psl_permission VALUES (75,'storyList','list stories'); INSERT INTO psl_permission VALUES (76,'storyeditothers','edit other authors stories'); INSERT INTO psl_permission VALUES (77,'storychangedate','can change date of stories'); INSERT INTO psl_permission VALUES (78,'storychangeauthor','can change the author of the story'); INSERT INTO psl_permission VALUES (79,'storydeleteothers','can delete other author's stories'); INSERT INTO psl_permission VALUES (80,'storylistothers','story list contains other author's stories'); --- NEW FILE: slash-all.sql --- # phpMyAdmin MySQL-Dump # http://phpwizard.net/phpMyAdmin/ # # Host: localhost Database : authperm # -------------------------------------------------------- # # Table structure for table 'active_sessions' # CREATE TABLE active_sessions ( sid varchar(32) NOT NULL, name varchar(32) NOT NULL, val text, changed varchar(14) NOT NULL, PRIMARY KEY (name, sid), KEY changed (changed) ); [...1165 lines suppressed...] # # Dumping data for table 'psl_variable' # INSERT INTO psl_variable (variable_id, variable_name, value, description, variable_group) VALUES ( '3', 'poll_currentquestionid', '18', 'The Current Question on the homepage pollbooth', ''); INSERT INTO psl_variable (variable_id, variable_name, value, description, variable_group) VALUES ( '57', 'article_nextprevlinks', '0', 'Adds next/prev links when viewing an article, but also requires a FULL TABLE SCAN.', ''); INSERT INTO psl_variable (variable_id, variable_name, value, description, variable_group) VALUES ( '40', 'site_name', 'PHPSlash', 'This is the name of the website', ''); INSERT INTO psl_variable (variable_id, variable_name, value, description, variable_group) VALUES ( '41', 'site_title', 'PHPSlash: Another title', 'Title for the website', ''); INSERT INTO psl_variable (variable_id, variable_name, value, description, variable_group) VALUES ( '43', 'site_slogan', 'News for nerds in templates that matter!', 'Web Site Slogan', ''); INSERT INTO psl_variable (variable_id, variable_name, value, description, variable_group) VALUES ( '49', 'site_logosmall', '', 'small logo', ''); INSERT INTO psl_variable (variable_id, variable_name, value, description, variable_group) VALUES ( '50', 'site_owner', 'web...@ph...', 'email address of the siteowner', ''); INSERT INTO psl_variable (variable_id, variable_name, value, description, variable_group) VALUES ( '60', 'article_updatehits', '1', 'If you want to keep track of the number of hits on an article, set this to true. REQUIRES AN UPDATE FOR EACH ARTICLE VIEW', ''); INSERT INTO psl_variable (variable_id, variable_name, value, description, variable_group) VALUES ( '59', 'block_optioncount', '4', 'the number of options for the block.', ''); INSERT INTO psl_variable (variable_id, variable_name, value, description, variable_group) VALUES ( '58', 'search_maxresults', '20', 'The maximum number of search results in the search page.', ''); INSERT INTO psl_variable (variable_id, variable_name, value, description, variable_group) VALUES ( '55', 'comment_defaultmode', 'nested', 'The default mode for displaying comments (flat, thread, nested, index)', ''); INSERT INTO psl_variable (variable_id, variable_name, value, description, variable_group) VALUES ( '61', 'submission_autodelete', '0', 'Deletes the submission *instantly* after clicking on the', ''); INSERT INTO psl_variable (variable_id, variable_name, value, description, variable_group) VALUES ( '62', 'site_homesection', 'Home', 'this section appears on the main index page.', ''); INSERT INTO psl_variable (variable_id, variable_name, value, description, variable_group) VALUES ( '63', 'mailinglist_subject', 'Slash list', 'The Subject for the mailing list newsletters', ''); |
From: Joe S. <joe...@us...> - 2002-05-23 18:35:10
|
Update of /cvsroot/phpslash/phpslash-ft/tables/0.7 In directory usw-pr-cvs1:/tmp/cvs-serv21709/0.7 Log Message: Directory /cvsroot/phpslash/phpslash-ft/tables/0.7 added to the repository |
From: Joe S. <joe...@us...> - 2002-05-21 20:32:47
|
Update of /cvsroot/phpslash/phpslash-ft In directory usw-pr-cvs1:/tmp/cvs-serv28198/phpslash-ft Modified Files: CHANGES Log Message: profile update message output Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.491 retrieving revision 1.492 diff -C2 -d -r1.491 -r1.492 *** CHANGES 21 May 2002 15:02:03 -0000 1.491 --- CHANGES 21 May 2002 20:07:23 -0000 1.492 *************** *** 13,17 **** 9 - Removal of something (kill -9 :) ! 2002-May-20 5:00PM CDT Joe Stewart <joe...@us...> [ET] - slashAuthCR.class, config.php3, loginformCR.tpl - use of authmode variable to set reg or log mode. --- 13,20 ---- 9 - Removal of something (kill -9 :) ! 2002-May-21 3:00PM CDT Joe Stewart <joe...@us...> ! [B] - profile.php3 - message output fixed. ! ! 2002-May-21 10:00AM CDT Joe Stewart <joe...@us...> [ET] - slashAuthCR.class, config.php3, loginformCR.tpl - use of authmode variable to set reg or log mode. |
From: Joe S. <joe...@us...> - 2002-05-21 20:32:46
|
Update of /cvsroot/phpslash/phpslash-ft/public_html In directory usw-pr-cvs1:/tmp/cvs-serv28198/phpslash-ft/public_html Modified Files: profile.php3 Log Message: profile update message output Index: profile.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/profile.php3,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** profile.php3 20 May 2002 19:52:48 -0000 1.1 --- profile.php3 21 May 2002 20:07:24 -0000 1.2 *************** *** 50,54 **** case "update": if($author->saveProfile($HTTP_POST_VARS)) { ! message("Profile Updated"); } else { error("Profile not updated"); --- 50,54 ---- case "update": if($author->saveProfile($HTTP_POST_VARS)) { ! echo message("Profile Updated"); } else { error("Profile not updated"); |