This file is indexed.

/usr/share/IlohaMail/source/bookmarks.php is in ilohamail 0.8.14-0rc3sid6.2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<?php
/////////////////////////////////////////////////////////
//	
//	source/bookmarks.php
//
//	(C)Copyright 2003 Ryo Chijiiwa <Ryo@IlohaMail.org>
//
//		This file is part of IlohaMail.
//		IlohaMail is free software released under the GPL 
//		license.  See enclosed file COPYING for details,
//		or see http://www.fsf.org/copyleft/gpl.html
//
/////////////////////////////////////////////////////////

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

	AUTHOR: Ryo Chijiiwa <ryo@ilohamail.org>
	FILE: source/bookmarks.php
	PURPOSE:
		Create/edit/delete bookmarks
	PRE-CONDITIONS:
		$user - Session ID
		
********************************************************/

	include("../include/super2global.inc");
	include("../include/header_main.inc");
	include("../include/langs.inc");
	include("../include/icl.inc");	
	include("../lang/".$my_prefs["lang"]."bookmarks.inc");
	include("../include/data_manager.inc");    
	
	//authenticate
	$conn=iil_Connect($host, $loginID, $password, $AUTH_MODE);
	if ($conn){
		if ($ICL_CAPABILITY["folders"]){
			if ($my_prefs["hideUnsubscribed"]){
				$mailboxes = iil_C_ListSubscribed($conn, $my_prefs["rootdir"], "*");
			}else{
				$mailboxes = iil_C_ListMailboxes($conn, $my_prefs["rootdir"], "*");
			}
			sort($mailboxes);
		}
		iil_Close($conn);
	}else{
		echo "Authentication failed.";
		echo "</body></html>\n";
		exit;
	}
	
	//make sure feature is not disabled
	if ($DISABLE_BOOKMARKS){
		echo $bmError[2];
		echo "</body></html>\n";
		exit;
	}

	//open DM connection
	$dm = new DataManager_obj;
	if ($dm->initialize($loginID, $host, $DB_BOOKMARKS_TABLE, $DB_TYPE)){
	}else{
		echo "Data Manager initialization failed:<br>\n";
		$dm->showError();
	}

	//do add
	if (isset($add)){
		if ((empty($new_name)) || (empty($new_url))) $error .= $bmError[1];
		else{
			if (!ereg("[fht]+tp[s]*://", $new_url)) $new_url = "http://".$new_url;
			$new_entry = array();
			$new_entry["name"] = $new_name;
			$new_entry["url"] = $new_url;
			$new_entry["grp"] = (empty($new_grp)?$new_grp_other:$new_grp);
			$new_entry["comments"] = $new_comments;
			$new_entry["is_private"] = $new_private;
						
			if ($dm->insert($new_entry)) echo "<!-- Inserted //-->";
			else echo "<!-- Not inserted //-->";
			
			$new_name = $new_url = $new_grp = $new_comments = $new_private = $new_grp_other = "";
		}
	}
	
	//do edit
	if (isset($edit) && ($edit_id > 0)){
		if (!ereg("[fht]+tp[s]*://", $edit_url)) $edit_url = "http://".$edit_url;
		$new_entry["name"] = $edit_name;
		$new_entry["url"] = $edit_url;
		$new_entry["grp"] = (empty($edit_grp)?$edit_grp_other:$edit_grp);
		$new_entry["comments"] = $edit_comments;
		$new_entry["is_private"] = $edit_private;
			
		if ($dm->update($edit_id, $new_entry)) echo "<!-- Updated! //-->";
		else echo "<!-- Not updated //-->";
		
		$edit_id = 0;
	}
	
	//do delete
	if (isset($delete) && ($edit_id > 0)){
		if ($dm->delete($edit_id)) $edit_id = 0;
		else $error .= "Deletion failed<br>\n";
	}
	
	//get sorted list of bookmarks
	$urls_a = $dm->sort("grp", "ASC");
	
	//get groups and form <option> list
	$groups = $dm->getDistinct("grp", "ASC");
	
	$error .= $dm->error;
	
	//show title and error
	?>
	<table border="0" cellspacing="2" cellpadding="0" width="100%">
	<tr bgcolor="<?php echo $my_colors["main_head_bg"]?>"><td><span class="bigTitle"><?php echo $bmStrings["bookmarks"]?></span></td></tr>
	</table>

	<font color="red"><?php echo $error?></font>
	<p>
	
	<?php
	echo "<center>\n";

	//list bookmark entries
	if (is_array($urls_a) && count($urls_a)>0){
		$prev_cat = "";
		reset($urls_a);
		echo '<table border="0" cellspacing="1" cellpadding="2" bgcolor="'.$my_colors["main_hilite"].'" width="95%">';
		while ( list($k, $v) = each($urls_a) ){
			$v = $urls_a[$k];
			if ($v["grp"]!=$prev_cat){
				echo '<tr bgcolor="'.$my_colors["main_head_bg"].'">';
				echo '<td colspan=3><span class="tblheader">'.$v["grp"].'</span></td>';
				echo '</tr>';
				$prev_cat = $v["grp"];
			}
			echo '<tr bgcolor="'.$my_colors["main_bg"].'">';
				echo "<td valign=\"middle\"><a href=\"bookmarks.php?user=$user&edit_id=".$v["id"]."\">".$v["name"]."</a></td>";
				//echo "<td valign=\"middle\"><nobr>".$v["name"]."</nobr></td>";
				echo "<td valign=\"middle\"><a href=\"".$v["url"]."\" target=_blank>".$v["url"]."</a></td>";
				echo "<td valign=\"middle\">".$v["comments"]."</td>";
			echo "</tr>\n";
		}
		echo "</table>";
	}


	//show edit/add form
	echo "<p>";

	if ($edit_id>0){
		reset($urls_a);
		while ( list($k,$foo) = each($urls_a) ){
			if ($urls_a[$k]["id"]==$edit_id){
				$v = $urls_a[$k];
				echo "Found $edit_id <br>\n";
			}
		}
?>
		<form method="post" action="<?php echo $_SERVER['PHP_SELF']."?user=".$user?>">
		<input type="hidden" name="user" value="<?php echo $user ?>">
		<input type="hidden" name="edit_id" value="<?php echo $edit_id ?>">
		<table border="0" cellspacing="1" cellpadding="1" bgcolor="<?php echo $my_colors["main_hilite"]?>" width="95%">
		<tr bgcolor="<?php echo $my_colors["main_head_bg"]?>">
			<td aling="center"><span class="tblheader"><?php echo $bmStrings["edit_url"]?></span></td>
		</tr>
		<tr bgcolor="<?php echo $my_colors["main_bg"]?>">
			<td align="center">
				<table>
					<tr>
						<td align="right"><?php echo $bmStrings["name"]?>:</td>
						<td><input type="text" name="edit_name" value="<?php echo $v["name"]?>" size="25">
						<?php echo $bmStrings["category"]?>:
						<select name="edit_grp">
						<?php 
							echo "<option value=\"\">".$bmStrings["other"]."\n";
							if (is_array($groups) && count($groups)>0){
								while ( list($k,$grp) = each($groups) ){
									echo "<option value=\"$grp\" ".($grp==$v["grp"]?"SELECTED":"").">$grp\n";
								}
							}
						?>
						</select>
						<input type="text" name="edit_grp_other" value="" size="15">
						</td>
					</tr>
					<tr>
						<td align="right"><?php echo $bmStrings["url"]?>:</td>
						<td><input type="text" name="edit_url" value="<?php echo $v["url"] ?>" size="60"></td>
					</tr>
					<tr>
						<td align="right" valign="top"><?php echo $bmStrings["comments"]?>:</td>
						<td>
						<input type="text" name="edit_comments" value="<?php echo htmlspecialchars(stripslashes($v["comments"]))?>" size="60">
						</td>
					</tr>
				</table>
				<input type="submit" name="edit" value="<?php echo $bmStrings["edit"]?>">
				<input type="submit" name="delete" value="<?php echo $bmStrings["delete"]?>">
			</td>
		</tr>
		</table>
		</form>
<?php
	}else{
?>
		<form method="post" action="<?php echo $_SERVER['PHP_SELF']."?user=".$user?>">
		<input type="hidden" name="user" value="<?php echo $user?>">
		<input type="hidden" name="session" value="<?php echo $user?>">
		<table border="0" cellspacing="1" cellpadding="1" bgcolor="<?php echo $my_colors["main_hilite"]?>" width="95%">
			<tr bgcolor="<?php echo $my_colors["main_head_bg"]?>">
				<td align="center"><span class="tblheader"><?php echo $bmStrings["new"]?></span></td>
			</tr>
			<tr bgcolor="<?php echo $my_colors["main_bg"]?>">
				<td align="center">
					<table>
						<tr>
							<td align="right"><?php echo $bmStrings["name"]?>:</td>
							<td><input type="text" name="new_name" value="<?php echo htmlspecialchars(stripslashes($new_name))?>" size="25">
							<?php echo $bmStrings["category"]?>:
							<select name="new_grp">
							<?php
								echo "<option value=\"\">".$bmStrings["other"]."\n";
								if (is_array($groups) && count($groups)>0){
									while ( list($k,$v) = each($groups) ){
										echo "<option value=\"$v\">$v\n";
									}
								}
							?>
							</select>
							<input type="text" name="new_grp_other" value="<?php echo $new_grp_other?>" size="15">
							</td>
						</tr>
						<tr>
							<td align="right"><?php echo $bmStrings["url"]?>:</td>
							<td><input type="text" name="new_url" value="<?php echo $new_url ?>" size="60"></td>
						</tr>
						<tr>
							<td align="right" valign="top"><?php echo $bmStrings["comments"]?>:</td>
							<td>
							<input type="text" name="new_comments" value="<?php echo htmlspecialchars(stripslashes($new_comments))?>" size="60">
							</td>
						</tr>
					</table>
					<input type="submit" name="add" value="<?php echo $bmStrings["add"]?>">
				</td>
			</tr>
		</table>
		</form>		
<?php
	}
?>
</BODY></HTML>