Changeset 1324 in ExiteCMS
- Timestamp:
- 02/28/08 15:19:38 (4 years ago)
- Location:
- modules/ExiteCMS/tracsvn/php-files/modules/tracsvn
- Files:
-
- 9 edited
-
admin.php (modified) (6 diffs)
-
module_installer.php (modified) (5 diffs)
-
svn.php (modified) (1 diff)
-
templates/modules.tracsvn.admin.tpl (modified) (2 diffs)
-
templates/modules.tracsvn.side_panel.tpl (modified) (1 diff)
-
templates/modules.tracsvn.svn.tpl (modified) (3 diffs)
-
templates/modules.tracsvn.trac.tpl (modified) (4 diffs)
-
tracsvn.side_panel.php (modified) (1 diff)
-
tracsvn_include.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/admin.php
r1320 r1324 25 25 26 26 if (isset($_POST['savesettings'])) { 27 27 28 // extract and validate the input 28 29 $database = stripinput($_POST['database']); … … 31 32 $auth = stripinput($_POST['auth']); 32 33 $extensions = stripinput($_POST['extensions']); 34 $view_svn = isNum($_POST['view_svn']) ? $_POST['view_svn'] : 102; 35 $view_diff = isNum($_POST['view_diff']) ? $_POST['view_diff'] : 102; 36 $view_file = isNum($_POST['view_file']) ? $_POST['view_file'] : 102; 37 33 38 $variables['message'] = ""; 34 39 35 40 // check if the database exists and is a Trac database 36 41 if (empty($database) || !dbtable_exists("revision", $database)) { … … 65 70 } 66 71 } 72 67 73 // if no errors are found, update 68 74 if ($variables['message'] == "") { … … 72 78 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$auth."' WHERE cfg_name = 'tracsvn_svnauth'"); 73 79 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$extensions."' WHERE cfg_name = 'tracsvn_extensions'"); 80 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$view_svn."' WHERE cfg_name = 'tracsvn_view_svn'"); 81 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$view_diff."' WHERE cfg_name = 'tracsvn_view_diff'"); 82 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$view_file."' WHERE cfg_name = 'tracsvn_view_file'"); 74 83 redirect(FUSION_SELF.$aidlink); 75 84 } 85 86 } elseif (isset($_POST['savealias'])) { 87 88 // process the selection 89 foreach($_POST['username'] as $idx => $user_id) { 90 if ($user_id) { 91 if ($_POST['orgmap'][$idx]) { 92 // update of a previous mapping 93 $result = dbquery("UPDATE ".$db_prefix."tracsvn_alias SET tracsvn_userid = '".$user_id."' WHERE tracsvn_username = '".stripinput($_POST['tracuser'][$idx])."'"); 94 } else { 95 // new mapping 96 $result = dbquery("INSERT INTO ".$db_prefix."tracsvn_alias (tracsvn_userid, tracsvn_username) VALUES ('".$user_id."', '".stripinput($_POST['tracuser'][$idx])."')"); 97 } 98 } else { 99 // no mapping for this trac user 100 $result = dbquery("DELETE FROM ".$db_prefix."tracsvn_alias WHERE tracsvn_username = '".stripinput($_POST['tracuser'][$idx])."'"); 101 } 102 } 103 redirect(FUSION_SELF.$aidlink); 104 76 105 } else { 106 107 // populate the fields for the settings panel 77 108 $database = $settings['tracsvn_database']; 78 109 $url = $settings['tracsvn_url']; … … 80 111 $auth = $settings['tracsvn_svnauth']; 81 112 $extensions = $settings['tracsvn_extensions']; 113 $view_svn = $settings['tracsvn_view_svn']; 114 $view_diff = $settings['tracsvn_view_diff']; 115 $view_file = $settings['tracsvn_view_file']; 116 117 // get the list of user groups 118 $groups = getusergroups(); 119 $variables['usergroups'] = array(); 120 foreach ($groups as $group) { 121 $variables['usergroups'][] = $group; 122 } 123 124 // get the information for the alias panel 125 $tracusers = array(); 126 127 // if we have a valid Trac database configured... 128 if (!empty($database) && dbtable_exists("revision", $database)) { 129 // get the trac user accounts from the ticket table 130 $result = dbquery("SELECT DISTINCT owner, reporter FROM ".$settings['tracsvn_database'].".ticket"); 131 while ($data = dbarray($result)) { 132 // add it to the users array, if not already present 133 if (!in_array($data['owner'], $tracusers)) { 134 $tracusers[] = $data['owner']; 135 } 136 if (!in_array($data['reporter'], $tracusers)) { 137 $tracusers[] = $data['reporter']; 138 } 139 } 140 141 // get the trac user accounts from the revisions table 142 $result = dbquery("SELECT DISTINCT author FROM ".$settings['tracsvn_database'].".revision"); 143 while ($data = dbarray($result)) { 144 // add it to the users array, if not already present 145 if (!in_array($data['author'], $tracusers)) { 146 $tracusers[] = $data['author']; 147 } 148 } 149 150 // sort the users 151 sort($tracusers); 152 } 153 154 // get the alias mapping for this users 155 $variables['aliases'] = array(); 156 foreach($tracusers as $tracuser) { 157 $result = dbquery("SELECT t.*, u.user_name FROM ".$db_prefix."tracsvn_alias t, ".$db_prefix."users u WHERE t.tracsvn_userid = u.user_id AND tracsvn_username = '$tracuser'"); 158 if (dbrows($result)) { 159 $data = dbarray($result); 160 $variables['aliases'][] = array('tracuser' => $tracuser, 'user_id' => $data['tracsvn_userid'], 'user_name' => $data['user_name']); 161 } else { 162 $variables['aliases'][] = array('tracuser' => $tracuser, 'user_id' => 0, 'user_name' => ""); 163 } 164 } 165 166 // get the list of all users for the dropdown 167 $variables['members'] = array(); 168 $result = dbquery("SELECT user_id, user_name FROM ".$db_prefix."users WHERE user_status = '0' ORDER BY user_name"); 169 while ($data = dbarray($result)) { 170 $variables['members'][] = $data; 171 } 82 172 } 83 173 //_debug($variables, true); 84 174 // store the variables 85 175 $variables['database'] = $database; … … 88 178 $variables['auth'] = $auth; 89 179 $variables['extensions'] = $extensions; 180 $variables['view_svn'] = $view_svn; 181 $variables['view_diff'] = $view_diff; 182 $variables['view_file'] = $view_file; 90 183 91 184 // define the body panel variables -
modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/module_installer.php
r1320 r1324 72 72 $localestrings['en']['406'] = "Database not found, no access to database, or database is not a Trac database"; 73 73 $localestrings['en']['407'] = "Trac & SVN user aliases"; 74 $localestrings['en']['408'] = " Add alias";74 $localestrings['en']['408'] = "Save aliases"; 75 75 $localestrings['en']['409'] = "There are no aliases defined"; 76 76 $localestrings['en']['410'] = "Save settings"; 77 77 $localestrings['en']['411'] = "Trac MySQL database name:"; 78 78 $localestrings['en']['412'] = "Trac username"; 79 $localestrings['en']['413'] = "Member ";79 $localestrings['en']['413'] = "Member Name"; 80 80 $localestrings['en']['414'] = "Milestone"; 81 81 $localestrings['en']['415'] = ""; … … 114 114 $localestrings['en']['448'] = "Generate diffs for file extensions:"; 115 115 $localestrings['en']['449'] = "Could not connect to the SVN repository. Output of the command is:<br />"; 116 $localestrings['en']['450'] = "View SubVersion information:"; 117 $localestrings['en']['451'] = "View SVN commit diffs:"; 118 $localestrings['en']['452'] = "View SVN source files:"; 116 119 117 120 $localestrings['en']['500'] = "Changeset"; … … 144 147 $localestrings['nl']['406'] = "Database niet gevonden, geen toegang tot de database, of de database is geen Trac database"; 145 148 $localestrings['nl']['407'] = "Trac & SVN gebruikersaliassen"; 146 $localestrings['nl']['408'] = "Alias toevoegen";149 $localestrings['nl']['408'] = "Aliasen aanpassen"; 147 150 $localestrings['nl']['409'] = "Er zijn geen aliassen gedefinieerd"; 148 151 $localestrings['nl']['410'] = "Bewaar instellingen"; 149 152 $localestrings['nl']['411'] = "Trac MySQL database naam:"; 150 153 $localestrings['nl']['412'] = "Trac gebruiker"; 151 $localestrings['nl']['413'] = "Lid ";154 $localestrings['nl']['413'] = "Lid naam"; 152 155 $localestrings['nl']['414'] = "Mijlpaal"; 153 156 $localestrings['nl']['415'] = "Opgeleverd op"; … … 186 189 $localestrings['nl']['448'] = "Genereer diffs voor deze file extensies:"; 187 190 $localestrings['nl']['449'] = "Kan geen verbinding maken met de SVN repository. Uitvoer van het commando is:<br />"; 191 $localestrings['nl']['450'] = "SubVersion informatie bekijken:"; 192 $localestrings['nl']['451'] = "SVN commit diffs bekijken:"; 193 $localestrings['nl']['452'] = "SVN bron bestanden bekijken:"; 188 194 189 195 $localestrings['nl']['500'] = "Changeset"; … … 219 225 $mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ".$db_prefix."configuration( cfg_name, cfg_value ) VALUES ('tracsvn_svnauth', '--username name_here --password pass_here')"); 220 226 $mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ".$db_prefix."configuration( cfg_name, cfg_value ) VALUES ('tracsvn_extensions', 'php,tpl,sh')"); 227 $mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ".$db_prefix."configuration( cfg_name, cfg_value ) VALUES ('tracsvn_view_svn', '102')"); 228 $mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ".$db_prefix."configuration( cfg_name, cfg_value ) VALUES ('tracsvn_view_diff', '102')"); 229 $mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ".$db_prefix."configuration( cfg_name, cfg_value ) VALUES ('tracsvn_view_file', '102')"); 221 230 222 231 // create the table: tracsvn_alias 223 232 $mod_install_cmds[] = array('type' => 'db', 'value' => "CREATE TABLE ##PREFIX##tracsvn_alias ( 224 tracsvn_id mediumint(8) unsigned NOT NULL default '0',233 tracsvn_id mediumint(8) unsigned NOT NULL AUTO_INCREMENT, 225 234 tracsvn_userid mediumint(8) unsigned NOT NULL default '0', 226 235 tracsvn_username varchar(50) NOT NULL default '', -
modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/svn.php
r1320 r1324 28 28 29 29 // get the rights for the current user 30 $variables['view_svn'] = true;30 $variables['view_svn'] = iMEMBER && checkgroup($settings['tracsvn_view_svn']); 31 31 if (!$variables['view_svn']) { 32 32 // redirect back to the trac module 33 33 redirect("trac.php"); 34 34 } 35 $variables['view_diff'] = true;36 $variables['view_file'] = true;35 $variables['view_diff'] = iMEMBER && checkgroup($settings['tracsvn_view_diff']); 36 $variables['view_file'] = iMEMBER && checkgroup($settings['tracsvn_view_file']); 37 37 38 38 // check if we have a revision number -
modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/templates/modules.tracsvn.admin.tpl
r1320 r1324 65 65 </td> 66 66 </tr> 67 68 <tr> 69 <td width='50%' class='tbl'> 70 {$locale.450} 71 </td> 72 <td width='50%' class='tbl'> 73 <select name='view_svn' class='textbox'> 74 {section name=id loop=$usergroups} 75 <option value='{$usergroups[id].0}'{if $usergroups[id].0 == $view_svn} selected="selected"{/if}>{$usergroups[id].1}</option> 76 {/section} 77 </select> 78 </td> 79 </tr> 80 <tr> 81 <td width='50%' class='tbl'> 82 {$locale.451} 83 </td> 84 <td width='50%' class='tbl'> 85 <select name='view_diff' class='textbox'> 86 {section name=id loop=$usergroups} 87 <option value='{$usergroups[id].0}'{if $usergroups[id].0 == $view_diff} selected="selected"{/if}>{$usergroups[id].1}</option> 88 {/section} 89 </select> 90 </td> 91 </tr> 92 <tr> 93 <td width='50%' class='tbl'> 94 {$locale.452} 95 </td> 96 <td width='50%' class='tbl'> 97 <select name='view_file' class='textbox'> 98 {section name=id loop=$usergroups} 99 <option value='{$usergroups[id].0}'{if $usergroups[id].0 == $view_file} selected="selected"{/if}>{$usergroups[id].1}</option> 100 {/section} 101 </select> 102 </td> 103 </tr> 67 104 <tr> 68 105 <td align='center' colspan='2' class='tbl'> … … 75 112 {include file="_closetable.tpl"} 76 113 {include file="_opentable.tpl" name=$_name title=$locale.407 state=$_state style=$_style} 77 <table align='center' cellpadding='0' cellspacing='1' class='tbl-border' width='500'> 78 <tr> 79 <td class='tbl2' align='center'> 80 {$locale.412} 81 </td> 82 <td class='tbl2' align='center'> 83 {$locale.413} 84 </td> 85 </tr> 86 {section name=id loop=$aliases} 114 <form name='aliasform' method='post' action='{$smarty.const.FUSION_SELF}{$aidlink}'> 115 <table align='center' cellpadding='0' cellspacing='1' class='tbl-border' width='500'> 87 116 <tr> 88 <td class='tbl1' align='center'> 117 <td class='tbl2' width='50%' align='center'> 118 <b>{$locale.412}</b> 89 119 </td> 90 <td class='tbl1' align='center'> 120 <td class='tbl2' width='50%' align='center'> 121 <b>{$locale.413}</b> 91 122 </td> 92 123 </tr> 93 {sectionelse} 124 {section name=id loop=$aliases} 125 <tr> 126 <td class='tbl1' align='center'> 127 {$aliases[id].tracuser} 128 <input type='hidden' name='tracuser[]' value='{$aliases[id].tracuser}' /> 129 <input type='hidden' name='orgmap[]' value='{$aliases[id].user_id}' /> 130 </td> 131 <td class='tbl1' align='center'> 132 <select name='username[]' class='textbox' style='width:200px;'> 133 <option value='0'{if $aliases[id].user_id == 0} selected='selected'{/if}></option> 134 {section name=usr loop=$members} 135 <option value='{$members[usr].user_id}'{if $aliases[id].user_id == $members[usr].user_id} selected='selected'{/if}>{$members[usr].user_name}</option> 136 {/section} 137 </section> 138 </td> 139 </tr> 140 {sectionelse} 141 <tr> 142 <td class='tbl1' colspan='2' align='center'> 143 {$locale.409} 144 </td> 145 </tr> 146 {/section} 147 </table> 148 <br /> 149 <table align='center' cellpadding='0' cellspacing='0' width='500'> 94 150 <tr> 95 <td class='tbl1' colspan='2' align='center'>96 {$locale.409}151 <td align='center' colspan='2' class='tbl'> 152 <input type='submit' name='savealias' value='{$locale.408}' class='button' /> 97 153 </td> 98 154 </tr> 99 {/section} 100 </table> 101 <br /> 102 <table align='center' cellpadding='0' cellspacing='0' width='500'> 103 <tr> 104 <td align='center' colspan='2' class='tbl'> 105 <input type='submit' name='addalias' value='{$locale.408}' class='button' /> 106 </td> 107 </tr> 108 </table> 155 </table> 156 </form> 109 157 {include file="_closetable.tpl"} 110 158 {***************************************************************************} -
modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/templates/modules.tracsvn.side_panel.tpl
r1320 r1324 26 26 <br /> 27 27 <span class='small'>{$locale.404}</span> 28 <b>{$dev }</b>28 <b>{$dev.user_name}</b> 29 29 </div> 30 30 {else} -
modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/templates/modules.tracsvn.svn.tpl
r1320 r1324 105 105 </td> 106 106 <td class='tbl' align='left'> 107 {$revs.author} 107 {if $revs.author.user_id} 108 <a href='{$smarty.const.BASEDIR}profile.php?lookup={$revs.author.user_id}' title=''>{$revs.author.user_name}</a> 109 {else} 110 {$revs.author.user_name} 111 {/if} 108 112 </td> 109 113 </tr> … … 135 139 <div style='float:left;background-color:#ffffff;height:7px;width:7px;margin-top:3px;margin-right:4px;border:1px solid #000;'></div> 136 140 {/if} 137 {if $nodes[id].change_type != "D" } {* No links to deleted files *}141 {if $nodes[id].change_type != "D" && $view_file} 138 142 <a href='{$smarty.const.FUSION_SELF}?rev={$rev}&file={$nodes[id].path}' title='{$locale.517}'>{$nodes[id].s_path}</a> 139 143 {else} … … 259 263 <span class='small'>{$revs[id].time|date_format:"%H:%M"}</span> 260 264 </td> 261 <td class='tbl '>265 <td class='tbl2'> 262 266 {$locale.500} 263 <a href='{$smarty.const.FUSION_SELF}?rev={$revs[id].rev}' title='{$locale.516}'>[{$revs[id].rev}]</a> 264 {$locale.404} {$revs[id].author} 265 <br /> 266 {$revs[id].message} 267 </td> 268 </tr> 269 267 [<a href='{$smarty.const.FUSION_SELF}?rev={$revs[id].rev}' title='{$locale.516}'>{$revs[id].rev}</a>] 268 {$locale.404} 269 {if $revs[id].author.user_id} 270 <a href='{$smarty.const.BASEDIR}profile.php?lookup={$revs[id].author.user_id}' title=''>{$revs[id].author.user_name}</a> 271 {else} 272 {$revs[id].author.user_name} 273 {/if} 274 </td> 275 </tr> 276 <tr> 277 <td class='tbl2' align='right' valign='top' width='1%' style='white-space:nowrap;'> 278 </td> 279 <td class='tbl' > 280 <div style='float;white-space:nowrap;overflow:auto'><img src='{$smarty.const.THEME}images/bullet.gif' alt='' /> {$revs[id].message}</div> 281 </td> 282 </tr> 270 283 {sectionelse} 271 284 {/section} -
modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/templates/modules.tracsvn.trac.tpl
r1320 r1324 169 169 </td> 170 170 <td class='tbl1' align='left'> 171 {$ticket.reporter} 171 {if $ticket.reporter.user_id} 172 <a href='{$smarty.const.BASEDIR}profile.php?lookup={$ticket.reporter.user_id}' title=''>{$ticket.reporter.user_name}</a> 173 {else} 174 {$ticket.reporter.user_name} 175 {/if} 172 176 </td> 173 177 <td class='tbl2' align='left'> … … 175 179 </td> 176 180 <td class='tbl1' align='left'> 177 {$ticket.owner} 181 {if $ticket.owner.user_id} 182 <a href='{$smarty.const.BASEDIR}profile.php?lookup={$ticket.owner.user_id}' title=''>{$ticket.owner.user_name}</a> 183 {else} 184 {$ticket.owner.user_name} 185 {/if} 178 186 </td> 179 187 </tr> … … 240 248 <tr> 241 249 <td class='tbl2'> 242 <span style='small'>{$changes[id].time|date_format:"forumdate"} - {$locale.441} {$locale.404} {$changes[id].author}</span> 250 <span style='small'> 251 {$changes[id].time|date_format:"forumdate"} - {$locale.441} {$locale.404} 252 {if $changes[id].author.user_id} 253 <a href='{$smarty.const.BASEDIR}profile.php?lookup={$changes[id].author.user_id}' title=''>{$changes[id].author.user_name}</a> 254 {else} 255 {$changes[id].author.user_name} 256 {/if} 257 </span> 243 258 </td> 244 259 </tr> … … 248 263 {$changes[id].newvalue} 249 264 {elseif $changes[id].oldvalue == ""} 250 <img src='{$smart.const.THEME}/images/bullet.gif' alt='' /> <b>{$changes[id].field}</b> {$locale.441} {$locale.443} < /span class='small2'>{$changes[id].newvalue}</span>265 <img src='{$smart.const.THEME}/images/bullet.gif' alt='' /> <b>{$changes[id].field}</b> {$locale.441} {$locale.443} <span class='small2'>{$changes[id].newvalue}</span> 251 266 {else} 252 <img src='{$smart.const.THEME}/images/bullet.gif' alt='' /> <b>{$changes[id].field}</b> {$locale.441} {$locale.442} <span class='small2'>{$changes[id].oldvalue}</span> {$locale.443} < /span class='small2'>{$changes[id].newvalue}</span>267 <img src='{$smart.const.THEME}/images/bullet.gif' alt='' /> <b>{$changes[id].field}</b> {$locale.441} {$locale.442} <span class='small2'>{$changes[id].oldvalue}</span> {$locale.443} <span class='small2'>{$changes[id].newvalue}</span> 253 268 {/if} 254 269 </td> -
modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/tracsvn.side_panel.php
r1320 r1324 24 24 $variables['rev'] = $data['rev']; 25 25 $variables['date'] = $data['time']; 26 // translate SVN users to ExiteCMS users if needed 27 $result = dbquery("SELECT u.user_name FROM ".$db_prefix."users u, ".$db_prefix."tracsvn_alias t WHERE t.tracsvn_userid = u.user_id AND t.tracsvn_username = '".$data['author']."'"); 28 if (dbrows($result)) { 29 $data = dbarray($result); 30 $variables['dev'] = $data['user_name']; 31 } else { 32 $variables['dev'] = tracsvn_getalias($data['author']); 33 } 26 $variables['dev'] = tracsvn_getalias($data['author']); 34 27 } 35 28 } -
modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/tracsvn_include.php
r1320 r1324 39 39 function tracsvn_wiki2html($text) { 40 40 41 // get rid of double line breaks42 $text = str_replace("[[BR]]\r\n", "",$text);41 // get rid of trailing whitespace 42 $text = rtrim($text); 43 43 // bullit implies line break 44 $text = str_replace("\r\*", "\*", $text); 44 $text = str_replace("\r\n*", "*", $text); 45 $text = str_replace("[[BR]]*", "*", $text); 45 46 // bullet lists 47 $text = str_replace("\r\n *", "<br />*", $text); 46 48 $text = preg_replace("/\*\s(.*?)(\w)/i", "• \\1\\2", $text); 47 // line breaks 48 $text = str_replace("\r\n", "<br />", $text); 49 // convert linebreaks 50 if (FUSION_SELF == "trac.php") { 51 $text = str_replace("\r\n", "<br />", $text); 52 $text = str_replace("\n", "<br />", $text); 53 } else { 54 $text = str_replace("\r\n", "<br /><img src='".THEME."images/bullet.gif' alt=\"\" /> ", $text); 55 $text = str_replace("\n", "<br /><img src='".THEME."images/bullet.gif' alt=\"\" /> ", $text); 56 } 57 // forced line breaks 58 $text = str_replace("[[BR]]", "<br />", $text); 49 59 // strike-through 50 60 $text = preg_replace("/~~(.*?)~~/si", "<span style='text-decoration:line-through;'>\\1</span>", $text); … … 71 81 $text = preg_replace("/#([0-9]+)/si", "#<a href='trac.php?step=ticket&id=\\1' title=''>\\1</a>", $text); 72 82 } 83 $text = preg_replace("/rev. ([0-9]+)/i", "rev. <a href='svn.php?rev=\\1' title=''>\\1</a>", $text); 73 84 74 85 // return the converted text … … 82 93 83 94 // validate the parameter 84 if (!empty($tracname) && !is_string($tracname)) {95 if (!empty($tracname) && is_string($tracname)) { 85 96 // translate Trac/SVN users to ExiteCMS users if needed 86 $result = dbquery("SELECT u.user_ name FROM ".$db_prefix."users u, ".$db_prefix."tracsvn_alias t WHERE t.tracsvn_userid = u.user_id AND t.tracsvn_username = '$tracname' LIMIT 1");97 $result = dbquery("SELECT u.user_id, u.user_name FROM ".$db_prefix."users u, ".$db_prefix."tracsvn_alias t WHERE t.tracsvn_userid = u.user_id AND t.tracsvn_username = '$tracname' LIMIT 1"); 87 98 if (dbrows($result)) { 88 $data = dbarray($result); 89 $tracname = $data['user_name']; 90 } 91 } 92 93 // test code!!! 94 if ($tracname == "hverton") $tracname = "WanWizard"; 95 if ($tracname == "root") $tracname = "Webmaster"; 96 99 $tracname = dbarray($result); 100 } 101 } 102 // not found? maybe there's a direct link with a member 103 if (!is_array($tracname)) { 104 // check the users table 105 $result = dbquery("SELECT user_id, user_name FROM ".$db_prefix."users WHERE user_name = '$tracname' LIMIT 1"); 106 if (dbrows($result)) { 107 $tracname = dbarray($result); 108 } 109 } 110 111 // still not found? Use the tracname 112 if (!is_array($tracname)) { 113 $tracname = array('user_id' => '0', 'user_name' => $tracname); 114 } 115 97 116 return $tracname; 98 117 }
Note: See TracChangeset
for help on using the changeset viewer.
