This commit is contained in:
Mickaël Rémond 2015-02-11 12:45:43 +01:00
parent f0b54e1e1a
commit b9357194a3
81 changed files with 0 additions and 21088 deletions

View File

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -1,44 +0,0 @@
iJorge by Zbyszek Zolkiewski (C) 2009 VERSION 1.5-RC1
About.
Jorge is set of php scripts that are front-end for Oleg Palij mod_logdb.
Licensing.
Jorge is distributed by GPL License provided in COPYING file as well in parts in all source files.
Jorge uses jQuery library and some plugins, please read license info at http://docs.jquery.com/Licensing
Bug reporting:
If you found any bug or have any improvement idea you can contact me at (email/xmpp): zbyszek@jabster.pl
Patches are most welcome.
Requirements:
- working ejabberd 2.x (or higher) with mod_logdb (compatibile version is bundled with Jorge)
- mod_xmlrpc - revision 772
- mysql5 server
- any http server supporting PHP (5.2.x or higher) with gd, mcrypt and xmlrpc support
Client Requirements:
- Jorge is tested and compatibile with: Firefox 2.x, Firefox 3.x, Opera 9.x, Apple Safri 3.x,4.x and Google Chrome (IE7 and IE8+ may work but it is not recomended due to IE standards violations, IE6 is not supported at all)
- Web-browser _must_ have enabled javascript as Jorge strongly relay on jQuery and other js related scripts
- Cookies must be enabled
Installing:
- setup XML-RPC facility (mod_xmlrpc, available at http://svn.process-one.net/ejabberd-modules/mod_xmlrpc/trunk/ - Use rev772!)
- copy Jorge files into your http server (sugested vhost over SSL connection).
- set up database for Jorge (install/jorge.sql), see README inside install dir
- copy config.php.inc to config.php and edit file - READ CAREFULLY
- that's it!
Archive usage:
We can say that 1 milion messeges collected by the server consume approx. 65 Megabytes. Depending on number of users that use your server and
how many will activate logging, you must compute db partitions.
NO WARRANTY
THE PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY. IT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
!!!SECURITY NOTICE!!!
Before use check if you set registered_globals to off. It is *required* for security reasons!
Jorge is compatibile out of the box with: mod_security2 and php-hardened (suhosin) and easy to chroot.
It is strongly recomended to use encrypted sessions.
If you are using Hardened_PHP or Suhosin alter get.max_value_length to some greater value f.e 1024.

View File

@ -1,679 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
/This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require_once("headers.php");
require_once("upper.php");
if ($_GET['a']) {
$jump_link = "&amp;a=".$_GET['a'];
}
$html->set_overview('<h2>'.$cal_head[$lang].'</h2><small>'.$cal_notice[$lang].'. <a href="main.php?set_pref=1&amp;v=1'.$jump_link.'"><u>'.$change_view[$lang].'</u></a></small><br><br>');
if (isset($_GET['left'])) {
if ($enc->decrypt_url($_GET['left']) === true) {
$left = $enc->tslice;
}
else {
unset($left);
}
}
if (isset($_GET['right'])) {
if ($enc->decrypt_url($_GET['right']) === true) {
$right = $enc->tslice;
}
else {
unset($left);
}
}
$e_string = $_GET['a'];
$resource_id = $_GET['b'];
$start = $_GET['start'];
$jump_to = $_POST['jump_box'];
if ($jump_to!="") {
$mo=$jump_to;
}
if ($mo === "jump") {
unset($mo);
}
if ($enc->decrypt_url($e_string) === true) {
$tslice = $enc->tslice;
$talker = $enc->peer_name_id;
$server = $enc->peer_server_id;
$action = $enc->action;
$lnk = $enc->lnk;
// reencode string:
$e_string = $enc->crypt_url("tslice=$tslice&peer_name_id=$talker&peer_server_id=$server");
}
// avoid unnessesary validation, actualy...
if ($tslice) {
if (validate_date($tslice) === false) {
debug(DEBUG,"Date validation failed: $tslice");
unset ($tslice);
unset($e_string);
unset($talker);
unset($left);
unset($right);
unset($mo);
unset($action);
}
else{
debug(DEBUG,"Date set to: $tslice");
}
}
// some validation things...
if ($start) {
if ((validate_start($start))!==true) {
$start="0";
}
}
// set idx
if ($_GET['idx']) {
$idx = $_GET['idx'];
if ($enc->decrypt_url($idx) === true) {
if($db->set_ext_index($enc->single) !== true) {
unset($idx);
unset($action);
}
$idx = $enc->single;
}
else{
unset($idx);
unset($action);
}
}
// undo delete
if ($action === "undelete") {
if ($db->move_chat_from_trash($talker,$server,$tslice,$lnk,$idx) === true) {
$html->status_message($undo_info[$lang],"message");
}
else {
unset($talker);
$html->alert_message($oper_fail[$lang],"message");
}
}
if ($action === "delete") {
if ($db->move_chat_to_trash($talker,$server,$tslice,$lnk) === true) {
$undo = $enc->crypt_url("tslice=$tslice&peer_name_id=$talker&peer_server_id=$server&lnk=$lnk&action=undelete");
unset($talker);
$idx = $enc->crypt_url("single=".$db->get_last_idx()."");
$html->status_message('<center><div style="background-color: #fad163; text-align: center; width: 240pt;">'.$del_moved[$lang]
.'<a href="'.$view_type.'?a='.$undo.'&amp;idx='.$idx.'"> <span style="color: blue; font-weight: bold;"><u>Undo</u></span></a></div></center>');
}
else {
$html->alert_message($oper_fail[$lang],"message");
unset($talker);
}
}
// check few condition, what we're doing...
if ($tslice!="") {
list($y,$m,$selected) = split("-", $tslice);
$mo="$y-$m";
}
else {
if (isset($left)) {
$mo=$left;
}
if (isset($right)) {
$mo=$right;
}
}
if (!isset($mo)) {
$mo = date("Y-n");
}
// validate mo if fail, silently fallback to current date
if (validate_date($mo."-1") === false) {
unset ($tslice);
unset ($e_string);
unset ($talker);
$mo = date("Y-m");
}
// master div
$html->set_body('<div>');
// calendar div
if ($talker) {
$float="left;";
}
else {
$float="none;";
}
// select list
$db->get_user_stats_drop_down();
$ch_mo = $db->result;
// check if user have some chats
if (count($ch_mo)!=0) {
$html->set_body('<div style="text-align: center; width: 200px; float: '.$float.'">
<form id="t_jump" action="calendar_view.php" method="post" name="t_jump">
<select style="text-align: center; border: 0px; background-color: #6daae7; color:#fff; font-size: x-small;" name="jump_box" size="0" onchange="javascript:document.t_jump.submit();">
<option value="jump">'.$jump_to_l[$lang].'</option>
');
foreach($ch_mo as $result) {
list($s_y,$s_m) = split("-",$result[at_send]);
$sym="$s_y-$s_m";
if ($jump_to!="" AND $sym==$mo) {
$sel_box="selected";
}
else {
$sel_box="";
}
$html->set_body('<option value="'.$sym.'" '.$sel_box.'>'.verbose_date($result[at],$months_names,$weekdays,false,true).'</option>');
}
$html->set_body('</select></form>');
// now generate calendar
$db->get_user_stats_calendar($mo);
$result_for_days = $db->result;
$i=0;
// days
foreach($result_for_days as $result) {
$i++;
$days[$i] = str_replace("-","",$result[days]);
}
list($y,$m) = split("-", $mo);
$html->set_body(calendar($db,$user_id,$xmpp_host,$y,$m,$days,TOKEN,$url_key,$left,$right,$selected,$lang,$view_type,1,$null_a=0,$null_b=0,$cal_days,$enc,$months_names,$weekdays));
unset($days);
}
else {
$html->status_message($no_archives[$lang]);
}
// if we got day, lets display chats from that day but only if there are some
if ($tslice) {
$db->get_user_chats($tslice);
$result = $db->result;
if (count($result)>0) {
$display_conversations = true;
}
else{
$display_conversations = false;
}
}
if ($display_conversations === true) {
// we need to sort list by nickname so we need to combine 2 results: roster and mod_logdb chatlist:
foreach($result as $sort_me) {
$roster_name = query_nick_name($ejabberd_roster,$sort_me[username],$sort_me[server_name]);
$arr_key++;
if (!$roster_name) {
// split contact into 2 arrays: one with full jids, second without names - transports, agents..
$sorted_spec[$arr_key] = array(
"roster_name"=>$roster_name,
"username"=>$sort_me[username],
"server_name"=>$sort_me[server_name],
"todaytalk"=>$sort_me[todaytalk],
"server"=>$sort_me[server],
"lcount"=>$sort_me[lcount]
);
}
else {
$sorted_list[$arr_key] = array(
"roster_name"=>$roster_name,
"username"=>$sort_me[username],
"server_name"=>$sort_me[server_name],
"todaytalk"=>$sort_me[todaytalk],
"server"=>$sort_me[server],
"lcount"=>$sort_me[lcount]
);
}
}
// sort and split two lists: normal contacts and special contacts.
asort($sorted_list);
if (!$show_spec) {
$show_spec="1";
}
if ($sorted_spec AND $show_spec === "1") {
if ($sorted_list) {
$sorted_list = array_merge($sorted_list,$sorted_spec);
}
else{
$sorted_list = $sorted_spec;
}
}
$html->set_body('<td valign="top" style="padding-top: 15px;">
<table width="200" border="0" cellpadding="0" cellspacing="0" class="calbck_con">
<tr>
<td><img src="img/cal_corn_11.png" width="15" height="7"></td>
<td style="background-image: url(img/cal_bck_top.gif);"></td>
<td><img src="img/cal_corn_12.png" width="14" height="7"></td>
</tr>
<tr>
<td width="15" height="226" valign="top" class="calbckleft"><img src="img/cal_bck_left.png" width="15" height="116"></td>
<td width="100%" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="calhead">'.$chat_list_l[$lang].'</td>
</tr>
<tr><td height="5"></td></tr>
<tr align="center" class="caldays">
<td><div style="vertical-align: middle; overflow: auto; height: 210; border-left: 0px; border-bottom: 0px; padding:0px; margin: 0px;">
');
// select chatters
foreach ($sorted_list as $entry) {
$user_name = $entry[username];
$server_name = $entry[server_name];
if ($talker==$entry["todaytalk"] AND $server==$entry[server]) {
$bold_b="<font color=\"#ffcc00\"><b>";
$bold_e="</b></font>";
$mrk=1;
}
else {
$bold_b="";
$bold_e="";
$mrk=0;
}
$nickname = $entry[roster_name];
if (!$nickname) {
$calday_class="caldays4";
$nickname = $not_in_r[$lang];
$spec_con = '<br><span style="text-indent: 10px; font-size: smaller;">(<i>'.htmlspecialchars($server_name).'</i>)</span>';
unset($malpa);
}
else {
$calday_class="caldays3";
unset($spec_con);
$malpa = "@";
}
if ($mrk==1) {
$db->get_next_prev_day($entry[todaytalk],$entry[server],$tslice,"p");
$previous_t = $db->result->at;
$to_base_prev = $enc->crypt_url("tslice=$previous_t&peer_name_id=$entry[todaytalk]&peer_server_id=$entry[server]");
$db->get_next_prev_day($entry[todaytalk],$entry[server],$tslice,"n");
$next_t = $db->result->at;
$to_base_next = $enc->crypt_url("tslice=$next_t&peer_name_id=$entry[todaytalk]&peer_server_id=$entry[server]");
}
$to_base2 = $enc->crypt_url("tslice=$tslice&peer_name_id=$entry[todaytalk]&peer_server_id=$entry[server]");
if ($mrk==1 AND $previous_t != NULL) {
$html->set_body('<a class="nav_np" id="pretty" title="'.$jump_to_prev[$lang].': '.$previous_t.'" href="calendar_view.php?a='.$to_base_prev.'"><<< </a>');
}
$html->set_body('<a class="'.$calday_class.'" id="pretty" href="?a='.$to_base2.'" title="JabberID:;'.htmlspecialchars($user_name).$malpa.htmlspecialchars($server_name).';---;
<b>'.$chat_lines[$lang].$entry[lcount].'</b>">'.$bold_b.cut_nick($nickname).$bold_e.'</a>');
if ($mrk==1 AND $next_t != NULL) {
$html->set_body('<a class="nav_np" id="pretty" title="'.$jump_to_next[$lang].': '.$next_t.'" href="calendar_view.php?a='.$to_base_next.'"> >>></a>');
}
if ($spec_con) {
$html->set_body($bold_b.$spec_con.$bold_e);
}
$html->set_body('<br>');
}
$html->set_body('
</div></td></tr>
</table>
</td>
<td width="14" valign="top" class="calbckright"><img src="img/cal_bck_right.png" width="14" height="116"></td>
</tr>
<tr>
<td><img src="img/cal_corn_21.png" width="15" height="16"></td>
<td style="background-image: url(img/cal_bck_bot.png);"></td>
<td><img src="img/cal_corn_22.png" width="14" height="16"></td>
</tr>
</table>
');
}
$html->set_body('</div><div>');
// Chat thread:
if ($talker) {
$html->set_body('<td valign="top"><table border="0" class="ff"><tr>');
if (!$start) {
$start="0";
}
$db->get_num_lines($tslice,$talker,$server);
$nume = $db->result->cnt;
if ($start>$nume) {
$start=$nume-$num_lines_bro;
}
$db->get_user_name($talker);
$talker_name = $db->result->username;
$db->get_server_name($server);
$server_name = $db->result->server_name;
$nickname = query_nick_name($ejabberd_roster,$talker_name,$server_name);
if ($nickname === "") {
$nickname=$not_in_r[$lang];
$spec_mark = true;
}
else {
$spec_mark = false;
}
$predefined = $enc->crypt_url("jid=$talker_name@$server_name");
$html->set_body('<table id="maincontent" border="0" cellspacing="0" class="ff">
<tr><td colspan="4"><div id="fav_result"></div>
</td></tr>
');
if ($_GET['loc']) {
$loc_id=$_GET['loc'];
if ($loc_id=="2") {
$back_link_message=$chat_map_back[$lang];
$back_link="chat_map.php?chat_map=$predefined";
}
elseif($loc_id=="3") {
$back_link_message=$fav_back[$lang];
$back_link="favorites.php";
}
elseif($loc_id=="4") {
$back_link_message=$myl_back[$lang];
$back_link="my_links.php";
}
$html->set_body('<tr><td colspan="2" class="message"><a href="'.$back_link.'">'.$back_link_message.'</a></td><td></td></tr>');
}
if ($resource_id) {
$db->get_resource_name($resource_id);
$res_display = $db->result->resource_name;
$html->set_body('<tr><td colspan="4"><div style="background-color: #fad163; text-align: center; font-weight: bold;">'.$resource_warn[$lang].cut_nick(htmlspecialchars($res_display)).'. '
.$resource_discard[$lang].'<a class="export" href="?a='.$e_string.'">'.$resource_discard2[$lang].'</a></div></td></tr>');
}
$action_link = $enc->crypt_url("tslice=$tslice&peer_name_id=$talker&peer_server_id=$server&lnk=$e_string&action=delete");
$sess->set('export_nickname',$nickname); // pass to export
$html->set_body('
<tr class="header">
<td><b> '.$time_t[$lang].' </b></td><td><b> '.$user_t[$lang].' </b></td><td><b> '.$thread[$lang].'</b></td>
<td align="right" style="padding-right: 5px; font-weight: normal;">
');
// check favorite
$db->check_favorite($talker,$server,$tslice);
if ($db->result->cnt < 1) {
$html->set_body('
<form style="margin-bottom: 0;" action="favorites.php" method="post">
<input type="hidden" name="a" value="'.$_GET[a].'">
<input type="hidden" name="init" value="1">
<input class="fav" type="submit" value="'.$fav_add[$lang].'">
</form>
');
}
else {
$html->set_body('
<form style="margin-bottom: 0;" action="favorites.php" method="post">
<input type="hidden" name="a" value="'.$_GET[a].'">
<input type="hidden" name="init" value="1">
<i>'.$fav_favorited[$lang].'</i>
</form>
');
}
$html->set_body('<a id="pretty" title="'.$tip_export[$lang].'" class="menu_chat" href="export.php?a='.$e_string.'">'.$export_link[$lang].'</a>&nbsp; | &nbsp;'.$all_for_u[$lang].'
<a id="pretty" title="'.$all_for_u_m2_d[$lang].'" class="menu_chat" href="chat_map.php?chat_map='.$predefined.'"><u>'.$all_for_u_m2[$lang].'</u></a>
&nbsp;<small>|</small>&nbsp;
<a id="pretty" title="'.$all_for_u_m_d[$lang].'" class="menu_chat" href="search_v2.php?b='.$predefined.'"><u>'.$all_for_u_m[$lang].'</u></a>
&nbsp; | &nbsp;
<a id="pretty" title="'.$tip_delete[$lang].'" class="menu_chat" href="calendar_view.php?a='.$action_link.'">'.$del_t[$lang].'</a>
</td></tr>
<tr class="spacer"><td colspan="7"></td></tr>
<tbody id="searchfield">
');
if($db->get_user_chat($tslice,$talker,$server,$resource_id,$start,$num_lines_bro) === false) {
$html->alert_message($oper_fail[$lang]);
}
// processing messages. this should be handled as separate message_processor, so that tree view and calendar view can share the same code withoud redundancy. To be done in 2.0
$result = $db->result;
// some strings to pass to message_processor
$lang_pack = array(
$cont_chat_p[$lang],
$message_type_message[$lang],
$message_type_error[$lang],
$message_type_headline[$lang],
$resource_only[$lang],
$muc_message[$lang],
$my_links_save[$lang],
$verb_h[$lang],
$in_min[$lang],
$cont_chat[$lang]
);
// Sent all data to parsing function (message processor)
if (message_processor($tslice,$server_name,$start,$nickname,$result,$db,$html,$enc,TOKEN,$split_line,$lang_pack,$lang,$spec_mark,$e_string,$to_base_prev,$to_base_next) !== true) {
$html->alert_message($oper_fail[$lang]);
$html->destroy_content();
}
// limiting code
$html->set_body('<tr class="spacer"><td colspan="7"></td></tr><tr class="foot"><td style="text-align: center;" colspan="9">');
for($i=0;$i < $nume;$i=$i+$num_lines_bro){
if ($i!=$start) {
if ($resource_id) {
$add_res="&amp;b=$resource_id";
}
else {
$add_res="";
}
$html->set_body('<a class="menu_chat" href="?a='.$e_string.$add_res.'&amp;start='.$i.'"> <b>['.$i.']</b> </font></a>');
}
else {
$html->set_body('<span style="color: #fff;">-'.$i.'-</span> ');
}
}
$html->set_body('</td></tr>');
// limiting code - end
if (($nume-$start)>40) {
$html->set_body('<tr><td colspan="6" style="text-align: right; padding-right: 5px;"><a href="#top"><small>'.$back_t[$lang].'</small></a></td></tr>');
}
$html->set_body('</table></tr></table></td>');
}
$html->set_body('</div></div>');
require_once("footer.php");
?>

View File

@ -1,152 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require_once("headers.php");
require_once("upper.php");
$html->set_overview('<h2>'.$chat_map[$lang].'</h2>'.'<small>'.$chat_select[$lang].'</small>');
if ($_POST['chat_map']) {
$con_map = $enc->decrypt_url($_POST['chat_map']);
}
elseif ($_GET['chat_map']) {
$con_map = $enc->decrypt_url($_GET['chat_map']);
}
if($con_map === true) {
$con_map = $enc->jid;
}
else{
unset($con_map);
}
// prepare roster object
$ejabberd_roster->sort_by_nick("az");
$roster_chat = $ejabberd_roster->get_roster();
$html->set_body('<br><br><br>
<form id="c_map_form" action="chat_map.php" method="post" name="chat_map_form">
<p>'.$filter_tip[$lang].'</p>
<span style="padding-right: 20px">'.$chat_m_select[$lang].'</span>
<select id="c_map" style="text-align: center; border: 0px; background-color: #6daae7; color:#fff; font-size: x-small;" name="chat_map" size="0" onchange="javascript:document.chat_map_form.submit();">
<option value="null">'.$chat_c_list[$lang].'</option>
');
while (array_keys($roster_chat)) {
$jid = key($roster_chat);
$roster_item = array_shift($roster_chat);
$name = $roster_item[nick];
$grp = $roster_item[group];
if ($con_map==$jid) {
$selected="selected";
}
else {
$selected="";
}
$html->set_body('<option '.$selected.' value=\''.$enc->crypt_url("jid=$jid").'\'>'.htmlspecialchars($name).' ('.htmlspecialchars($grp).')</option>');
}
$html->set_body('</select></form>');
if ($con_map AND $_POST['chat_map'] != "null") {
// split username and server name
list($name_peer,$server_peer) = split("@",$con_map);
// get the id's of user and server
$db->get_user_id($name_peer);
$peer_name_id = $db->result->user_id;
$db->get_server_id($server_peer);
$peer_server_id = $db->result->server_id;
if ($peer_name_id !== null AND $peer_server_id !== null) {
//first get the months
$db->get_chat_map($peer_name_id,$peer_server_id);
$result1 = $db->result;
$cc_cmp = count($result1);
foreach ($result1 as $row_m) {
// hack for proper date parsing
list($y,$m) = split("-",$row_m[at]);
$mo="$y-$m";
// now get the days in with user was talking
$db->get_chat_map_specyfic($peer_name_id,$peer_server_id,$mo);
$result2 = $db->result;
foreach($result2 as $row_day) {
// now scan day for chats, yep thats weak, but as long as we dont have right stats table this will work...
$i++;
list($y,$m,$d) = split("-",$row_day[at]);
$days[$i] = $d;
}
if (count($days)>=1) {
$html->set_body('<table cellpadding="0" cellspacing="0" style="display:inline;"><tr><td style="width:200px; border: 0px; text-align:center;">');
$html->set_body(calendar($db,$user_id,$xmpp_host,$y,$m,$days,TOKEN,$url_key,$left,$right,$selected,$lang,$view_type,2,$peer_name_id,$peer_server_id,$cal_days,$enc,$months_names,$weekdays));
$html->set_body('</td></tr></table>');
unset($days);
}
else {
$score++;
}
$i=0;
}
}
else {
$cc_cmp = $score;
}
if ($score==$cc_cmp) {
$html->set_body('<span style="text-align: center;"><h2>'.$chat_no_chats[$lang].'</h2></span>');
}
}
$html->set_body('<br><small><i>*-'.$ff_notice[$lang].'</i></small>');
require_once("footer.php");
?>

File diff suppressed because it is too large Load Diff

View File

@ -1,257 +0,0 @@
<?
/*
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/*##################################################
PHP XML-RPC clss for mod_xmlrpc
-------------------------------
Author: Zbyszek Zolkiewski (zbyszek@jabster.pl)
TEST VERSION, NOT ALL CALLS INCLUDED! THERE IS NO DOCUMENTATION YET.
$ejabberd_rpc = new rpc_connector("IP_OF_RPC_SERVER","RPC_PORT","XMPP_HOST","OPTIONAL_USERNAME","OPTIONAL_PASSWORD","OPTIONAL_NEWPASS");
if no username is provided on object creation, you can set it via:
$ejabberd_rpc->set_user("username","password","optional-new_password");
this is usefull especialy for scripts like bulk account creation/deletion etc...
Method: Returned values:
crete_account() true|false|exist
delete_account() true|false
auth() true|false
check_account() true|flase
change_password() true|false
get_roster() Array()
test_rpc() String
Example of authentication:
try {
if($ejabberd_rpc->auth() === true) {
print "Auth OK";
}
else {
print "Unknown account or bad password";
}
}
catch(Exception $e) {
echo "Exception: ".$e->getMessage();
echo ", Code: ".$e->getCode();
}
*/##################################################
class rpc_connector {
protected $rpc_server;
protected $rpc_port;
protected $username;
protected $password;
protected $newpass;
protected $vhost;
protected $parms;
protected $method;
public function __construct($rpc_server,$rpc_port,$vhost,$username = null,$password = null,$newpass = null) {
$this->setData($rpc_server,$rpc_port,$vhost,$username,$password,$newpass);
}
protected function setData($rpc_server, $rpc_port, $vhost, $username, $password,$newpass) {
$this->rpc_server = $rpc_server;
$this->rpc_port = $rpc_port;
$this->vhost = $vhost;
$this->username = $username;
$this->password = $this->clean_password($password);
$this->newpass = $this->clean_password($newpass);
}
public function set_user($username,$password,$newpass = null) {
$this->username = $username;
$this->password = $this->clean_password($password);
$this->newpass = $this->clean_password($newpass);
}
protected function commit_rpc() {
$request = xmlrpc_encode_request($this->method,$this->parms);
$context = stream_context_create(array('http' => array(
'method' => "POST",
'header' => "Content-Type: text/xml; charset=utf-8\r\n" .
"User-Agent: XMLRPC::Client JorgeRPCclient",
'content' => $request
)));
$file = file_get_contents("http://$this->rpc_server".":"."$this->rpc_port", false, $context);
$response = xmlrpc_decode($file,"utf8");
if (xmlrpc_is_fault($response)) {
throw new Exception("XML-RPC Call Failed. Unrecoverable condition",0);
} else {
return $response;
}
}
protected function is_value($value) {
if($value === null) {
return false;
}
elseif($value==""){
return false;
}
else{
return true;
}
}
protected function clean_password($password) {
if (get_magic_quotes_gpc() === 1) {
return stripslashes($password);
}
return $password;
}
public function auth() {
$this->method = "check_password";
$this->parms = array("user"=>"$this->username","host"=>"$this->vhost","password"=>"$this->password");
if ($this->commit_rpc() === 0 ) {
return true;
}
else{
return false;
}
}
public function create_account() {
if ($this->is_value($this->username) === false OR $this->is_value($this->password) === false) { return false; }
$this->method = "create_account";
$this->parms = array("user"=>"$this->username","host"=>"$this->vhost","password"=>"$this->password");
$call = $this->commit_rpc();
if ($call === 0) {
return true;
}
elseif($call === 409) {
return "exist";
}
elseif($call === 1) {
return false;
}
}
public function check_account() {
if ($this->is_value($this->username) === false) { return false; }
$this->method = "check_account";
$this->parms = array("user"=>"$this->username","host"=>"$this->vhost");
if ($this->commit_rpc() === 1) {
return false;
}
else{
return true;
}
}
public function change_password() {
if ($this->is_value($this->newpass) === false OR $this->is_value($this->username) === false) { return false; }
$this->method = "change_password";
$this->parms = array("user"=>"$this->username","host"=>"$this->vhost","newpass"=>"$this->newpass");
if ($this->commit_rpc() === 0) {
$this->password = $this->newpass;
return true;
}
else{
return false;
}
}
public function get_roster() {
$this->method = "get_roster";
$this->parms = array("user"=>"$this->username","server"=>"$this->vhost");
return $this->commit_rpc();
}
public function delete_account() {
if ($this->is_value($this->password) === false OR $this->is_value($this->username) === false) { return false; }
$this->method = "delete_account";
$this->parms = array("user"=>"$this->username","host"=>"$this->vhost","password"=>"$this->password");
$this->commit_rpc();
if ($this->check_account() === false) {
return true;
}
else {
return false;
}
}
public function online_users() {
$this->method = "online_users";
$this->parms = "null";
return $this->commit_rpc();
}
public function test_rpc() {
$this->method = "echothis";
$this->parms = "If you can read this then RPC is working...";
return $this->commit_rpc();
}
}
?>

View File

@ -1,358 +0,0 @@
<?
/*
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
###########################################################################
Helper classes for Jorge. Performs various operations.
*/
Class url_crypt Extends parser {
private $td;
public function __construct($key) {
$td = mcrypt_module_open('des', '', 'ecb', '');
$key = substr($key, 0, mcrypt_enc_get_key_size($td));
$iv_size = mcrypt_enc_get_iv_size($td);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
mcrypt_generic_init($td, $key, $iv);
$this->td = $td;
}
public function __destruct() {
mcrypt_generic_deinit($this->td);
mcrypt_module_close($this->td);
}
public function crypt_url($url) {
return str_replace("+", "kezyt2s0", $this->url_encrypt($url));
}
public function decrypt_url($url) {
$url = str_replace("kezyt2s0", "+",$url);
return $this->decode_string($this->url_decrypt(base64_decode($url)));
}
private function url_encrypt($url) {
$prepared_string = "begin&".$url;
$integrity = md5($prepared_string);
$url = "integrity=$integrity&".$prepared_string;
$td = $this->td;
$c_t = mcrypt_generic($td, $url);
return base64_encode($c_t);
}
private function url_decrypt($url) {
$td = $this->td;
$p_t = mdecrypt_generic($td, $url);
return trim($p_t);
}
}
Class parser {
public $tslice = null;
public $peer_name_id = null;
public $peer_name = null;
public $peer_server_id = null;
public $peer_server = null;
public $jid = null;
public $ismylink = null;
public $linktag = null;
public $strt = null;
public $lnk = null;
public $action = null;
public $search_phase = null;
public $offset_arch = null;
public $offset_day = null;
public $tag_count = null;
public $time_start = null;
public $time_end = null;
public $single = null;
protected function decode_string($url) {
parse_str($url);
$reconstructed = strstr($url,"begin");
settype($integrity,"string");
if ($integrity === md5($reconstructed)) {
if (isset($tslice)) {
$this->tslice = $tslice;
}
if (isset($peer_name_id)) {
$this->peer_name_id = $peer_name_id;
}
if (isset($peer_server_id)) {
$this->peer_server_id = $peer_server_id;
}
if (isset($jid)) {
$this->jid = $jid;
}
if (isset($lnk)) {
$this->lnk = $lnk;
}
if (isset($ismylink)) {
$this->ismylink = $ismylink;
}
if (isset($linktag)) {
$this->linktag = $linktag;
}
if (isset($strt)) {
$this->strt = $strt;
}
if (isset($action)) {
$this->action = $action;
}
if (isset($peer_name)) {
$this->peer_name = $peer_name;
}
if (isset($peer_server)) {
$this->peer_server = $peer_server;
}
if (isset($search_phase)) {
$this->search_phase = $search_phase;
}
if (isset($offset_arch)) {
$this->offset_arch = $offset_arch;
}
if (isset($offset_day)) {
$this->offset_day = $offset_day;
}
if (isset($tag_count)) {
$this->tag_count = $tag_count;
}
if (isset($time_start)) {
$this->time_start = $time_start;
}
if (isset($time_end)) {
$this->time_end = $time_end;
}
if (isset($single)) {
$this->single = $single;
}
return true;
}
else {
return false;
}
return false;
}
}
Class render_html {
protected $html_head = array();
protected $html_menu = array();
protected $html_over;
protected $html_main = array();
protected $html_body = array();
protected $html_foot = array();
private $head_items = integer;
private $menu_items = integer;
private $main_items = integer;
private $body_items = integer;
private $foot_itesm = integer;
public function system_message($html) {
$this->html_main = array("sys_message"=>$this->render_system($html));
return;
}
public function status_message($html) {
$this->html_main = array("status_message"=>$this->render_status($html));
return;
}
public function alert_message($html) {
$this->html_main = array("alert_message"=>$this->render_alert($html));
return;
}
public function headers($html) {
if ($this->head_items === 0) {
$this->html_head = array("0"=>$html);
$this->head_items = 1;
}
else{
$this->head_items = $this->head_items + 1;
$this->html_head = $this->html_head += array($this->head_items=>$html);
}
return;
}
public function menu($html) {
if ($this->menu_items === 0) {
$this->html_menu = array("0"=>$html);
$this->menu_items = 1;
}
else{
$this->menu_items = $this->menu_items + 1;
$this->html_menu = $this->html_menu += array($this->menu_items=>$html);
}
return;
}
public function set_overview($html) {
$this->html_over = $html;
return;
}
public function set_body($html) {
if ($this->body_items === 0) {
$this->html_body = array("0"=>$html);
$this->body_items = 1;
}
else{
$this->body_items = $this->body_items + 1;
$this->html_body = $this->html_body += array($this->body_items=>$html);
}
return;
}
public function foot($html) {
if ($this->foot_items === 0) {
$this->html_foot = array("0"=>$html);
$this->foot_items = 1;
}
else{
$this->foot_items = $this->foot_items + 1;
$this->html_foot = $this->html_foot += array($this->foot_items=>$html);
}
return;
}
public function commit_render() {
$html_head = $this->html_head;
$html_menu = $this->html_menu;
$html_over = $this->html_over;
$html_main = $this->html_main;
$html_body = $this->html_body;
$html_foot = $this->html_foot;
for ($z=0;$z<=$this->head_items;$z++) {
$out .= $html_head[$z];
}
$out .= $html_main[sys_message];
for ($z=0;$z<=$this->menu_items;$z++) {
$out .= $html_menu[$z];
}
$out .= $html_over;
$out .= $html_main[alert_message];
$out .= $html_main[status_message];
for ($z=0;$z<=$this->body_items;$z++) {
$out .= $html_body[$z];
}
for ($z=0;$z<=$this->foot_items;$z++) {
$out .= $html_foot[$z];
}
echo $out;
return;
}
public function destroy_content() {
$this->html_body = array();
return;
}
protected function render_alert($message, $class = "message") {
return '<center><div class="'.$class.'">'.$message.'</div><br></center>';
}
protected function render_status($message, $class = "message") {
return '<center><div class="'.$class.'">'.$message.'</div><br></center>';
}
protected function render_system($message, $class = null) {
return '<center><div class="system">'.$message.'</div><br></center>';
}
}
?>

View File

@ -1,147 +0,0 @@
<?
/*
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*
Known issue:
Roster index have unique key set on JabberID so if user have same jid in 2 or more groups only first is included in index. As this is quite rare situation i consider it as minor bug and will be fixed later.
*/
class roster {
protected $roster_item;
protected $roster;
public function add_item($jid,$nick,$group) {
$new_item[$jid] = array("nick"=>$nick,"group"=>$group);
if ($this->roster) {
$this->roster = $this->roster += $new_item;
}
else {
$this->roster = $new_item;
}
}
public function get_roster() {
return $this->roster;
}
public function get_nick($jid) {
$roster = $this->roster;
$nick = $roster[$jid][nick];
return htmlspecialchars($nick);
}
public function get_group($jid) {
$roster = $this->roster;
$group = $roster[$jid][group];
return htmlspecialchars($group);
}
public function get_nick_group($jid) {
$roster = $this->roster;
$result = array($roster[$jid][nick],$roster[$jid][group]);
return $result;
}
public function sort_by_jid($dir) {
$arr = $this->roster;
if ($dir==="az") {
ksort($arr);
}
elseif($dir==="za") {
krsort($arr);
}
else{
return false;
}
$this->roster = $arr;
}
public function sort_by_nick($dir) {
$this->sort_roster($dir,"nick");
}
public function sort_by_group($dir) {
$this->sort_roster($dir,"group");
}
public function sort_by_nick_group() {
$arr = $this->roster;
array_multisort($this->prepare_multisort("group"),SORT_ASC, $this->prepare_multisort("nick"),SORT_ASC,$arr);
$this->roster = $arr;
}
protected function sort_roster($dir,$field) {
$arr = $this->roster;
if ($dir ==="az") {
array_multisort($this->prepare_multisort("$field"),SORT_ASC,$arr);
}
elseif($dir==="za") {
array_multisort($this->prepare_multisort("$field"),SORT_DESC,$arr);
}
else{
return false;
}
$this->roster = $arr;
}
protected function prepare_multisort($val) {
$arr = $this->roster;
foreach ($arr as $key => $row) {
$field[$key] = $row[$val];
}
$ret = array_map('strtolower', $field);
return $ret;
}
}
?>

View File

@ -1,68 +0,0 @@
<?php
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
if (__FILE__==$_SERVER['SCRIPT_FILENAME']) {
header("Location: index.php?act=logout");
exit;
}
class session {
public $id;
function session ($lifetime=10800) { // czas ?ycia sesji
@session_start();
}
function unregister($name) {
unset($HTTP_SESSION_VARS[$name]);
}
function is_registered($name) {
if (isset($_SESSION[$name])) return true;
else return false;
}
function get($name) {
return $_SESSION[$name];
}
function set($name,$value) {
$_SESSION[$name]=$value;
}
// zwraca id sesji uzytkownika
function id() {
return(@session_id());
}
// ubija sesje - logout
function finish() {
//$id_session = $this->id();
@session_unset();
@session_destroy();
}
}
?>

View File

@ -1,99 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
// Print debuging information (true|false). Do NOT set as true on producion servers!
define("DEBUG", false);
define("SQL_DEBUG",false); // sql debug
// Language support. Add your language below. DO NOT change IDs after jorge usage as this IDs are held in jorge_pref table.
$language_support = array(
"Polski"=> array ("pol","1"),
"English"=> array("eng", "2")
);
// Define default language. Should be the name from language_support array.
define(default_language, "English");
// vhost and RPC settings
// RPC port:
$rpc_port="4666";
// vhost settings, format "xmpp.server.com"=>array of RPC servers (WARNING! Do not mistake vhost and RPC servers as this is crutial for authentication!)
$vhosts = array(
"jabber.example.com"=>
array("10.0.0.1","10.0.0.2"),
"jabber.example.eu"=>
array("10.0.0.3","10.0.0.4")
);
// array of admins for domain
$vhosts_admins = array(
"jabber.example.com"=> array("admin1","admin2","admin3"),
"jabber.example.eu"=> array("admin10","admin20")
);
// MySQL database where mod_logdb is running on:
define("MYSQL_USER", ""); // username
define("MYSQL_PASS", ""); // password
define("MYSQL_NAME",""); // db name
define("MYSQL_HOST", ""); // host ip
// Since version 1.5 Jorge is using reCAPTCHA code. Before running Jorge please go to: http://recaptcha.net/ and setup your account and get private key and public key:
define("CAPTCHA_PRIVATE","");
define("CAPTCHA_PUBLIC","");
// secret key for scrambling URLs. Put here some random data (32 chars):
define("ENC_KEY","PleaseChangeMe");
// Turn SSL redirection in PHP
define("SSL_REDIRECT", "false");
// number of chat lines in browser (default: 300)
$num_lines_bro = "300";
// number of search results (default: 100)
$num_search_results = "100";
// splitting line. Value in seconds. Default 900s = 15 minutes
$split_line="900";
// links
$links='<a class="foot" href="http://www.jabster.pl" target="_blank">jabster.pl</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a class="foot" href="http://poczta.jabster.pl" target="_blank">poczta</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a class="foot" href="http://kalendarz.jabster.pl" target="_blank">kalendarz</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a class="foot" href="http://docs.jabster.pl" target="_blank">dokumenty</a>
';
// copyright
$copy = "jabster.pl &copy; 2009";
// custom logo
$brand_logo = "logo_jabster.png";
?>

View File

@ -1,191 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require_once("headers.php");
require_once("upper.php");
$html->set_overview('<h2>'.$con_head[$lang].'</h2><small>'.$con_notice[$lang].'</small>');
if ($_POST) {
while (array_keys($_POST)) {
$jid = base64_decode(str_replace("kezyt2s0", "+", key($_POST)));
$val = array_shift($_POST);
if ($val=="n") {
$do_not_log_list .=$jid."\n";
}
}
if ($db->update_log_list($do_not_log_list) === true) {
$html->status_message($con_saved[$lang]);
}
else {
$html->alert_message($oper_fail[$lang]);
}
}
// sorting options
$get_sort = $_GET['sort'];
$get_dir = $_GET['o'];
// validate
if (!ctype_digit($get_sort) AND !ctype_digit($get_dir)) { unset($get_sort); unset($get_dir); }
if ($get_dir === "1") {
$dir = "za";
$get_dir = "2";
}
elseif($get_dir === "2"){
$dir = "az";
$get_dir = "1";
}
else{
$dir = "az";
$get_dir = "2";
}
if ($get_sort === "1") {
$ejabberd_roster->sort_by_jid($dir);
}
elseif($get_sort === "2") {
$ejabberd_roster->sort_by_nick($dir);
}
elseif($get_sort === "3") {
$ejabberd_roster->sort_by_group($dir);
}
else{
$ejabberd_roster->sort_by_nick_group();
}
$roster_con = $ejabberd_roster->get_roster();
if ($roster_con) {
$db->get_log_list();
$do_notlog_list = $db->result;
$html->set_body('<center><form action="contacts.php" method="post"><table id="maincontent" border="0" class="ff" cellspacing="0">');
if ($get_sort) {
$html->set_body('<tr><td colspan="5" style="text-align: right; font-size: x-small;"><a href="contacts.php">'.$reset_sort[$lang].'</a></td></tr>');
}
$html->set_body('<tr class="header">
<td><a href="?sort=2&o='.$get_dir.'"><span style="color: white;">'.$con_tab2[$lang].'&nbsp;&#8593;&#8595;</span></a></td>
<td><a href="?sort=1&o='.$get_dir.'"><span style="color: white;">'.$con_tab3[$lang].'&nbsp;&#8593;&#8595;</span></a></td>
<td style="text-align: center;"><a href="?sort=3&o='.$get_dir.'"><span style="color: white;">'.$con_tab6[$lang].'&nbsp;&#8593;&#8595;</span></a></td>
<td>'.$show_chats[$lang].':</td>
<td style="padding-left: 10px;">'.$con_tab4[$lang].'</td>
</tr>
<tr class="spacer"><td colspan="5"></td></tr>
<tbody id="searchfield">
');
while (array_keys($roster_con)) {
$jid = key($roster_con);
$roster_item = array_shift($roster_con);
$nick = $roster_item[nick];
$grp = $roster_item[group];
$predefined = $enc->crypt_url("jid=$jid");
$prepared_jid=str_replace("+", "kezyt2s0", base64_encode($jid));
if ($col=="e0e9f7") {
$col="e8eef7";
}
else {
$col="e0e9f7";
}
if (in_array($jid,$do_notlog_list) === true) {
$selected="selected";
}
else {
$selected="";
}
if ($selected!="") {
$col="b7b7b7";
}
$html->set_body('
<tr bgcolor="'.$col.'" onMouseOver="this.bgColor=\'c3d9ff\';" onMouseOut="this.bgColor=\'#'.$col.'\';">
<td style="padding-left:7px"><b>'.cut_nick(htmlspecialchars($nick)).'</b></td>
<td>(<i>'.htmlspecialchars($jid).'</i>)</td>
<td style="text-align: center;">'.cut_nick(htmlspecialchars($grp)).'</td>
<td style="text-align: center;"><a href="chat_map.php?chat_map='.$predefined.'"><u>'.$show_chat_as_map[$lang].'</u></a>|
<a href="search_v2.php?b='.$predefined.'"><u>'.$show_chat_stream[$lang].'</u></a></td>
<td style="text-align: center;">
<select class="cc2" name="'.$prepared_jid.'">
<option value="y">'.$con_tab_act_y[$lang].'</option>
<option value="n" '.$selected.' >'.$con_tab_act_n[$lang].'</option>
</select></td></tr>
');
}
$html->set_body('<tr class="spacer"><td colspan="5"></td></tr>
</tbody>
<tr class="foot"><td colspan="5" style="text-align: center;">
<input class="submit" type="submit" value="'.$con_tab_submit[$lang].'"></td></tr>
</table></form></center>
');
}
else {
$html->status_message('<p align="center"><b>'.$no_contacts[$lang].'</b></p>');
}
require_once("footer.php");
?>

View File

@ -1,208 +0,0 @@
<?php
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
// Suppress all errors
error_reporting(E_NONE);
require("func.php");
require("class.sessions.php");
require("class.ejabberd_xmlrpc.php");
require("class.db.php");
require("class.roster.php");
require("class.helper.php");
require("config.php");
ob_start();
// init session
$sess = new session;
// Select language
if ($sess->get('language')) {
// Validate language setting in session
if (is_language_supported($sess->get('language'),$language_support) === true) {
require('lang/'.$sess->get('language').'.php');
}
else{
// In case of invalid session, overwrite value
require('lang/'.$language_support[default_language][0].'.php');
$sess->set('language',$language_support[default_language][0]);
}
}
else{
// If no lang in sess, set it anyway...
require('lang/'.$language_support[default_language][0].'.php');
$sess->set('language',$language_support[default_language][0]);
}
// language
$lang = $sess->get('language');
define(XMPP_HOST,$sess->get('vhost'));
$xmpp_host = str_replace(".","_", XMPP_HOST);
$rpc_host = check_rpc_server($vhosts[XMPP_HOST],$rpc_port);
// in case no RPC servers are available stop jorge
if ($rpc_host===false) {
print "<br><center><b>Currently service is unavailable. Please try again later.</b></center>";
exit;
}
// connect to xmpp server
$ejabberd_rpc = new rpc_connector("$rpc_host","$rpc_port",XMPP_HOST);
// initialize encryption system
$enc = new url_crypt(ENC_KEY);
// authenticate
if (check_registered_user($sess,$ejabberd_rpc,$enc) !== true) {
header("Location: index.php?act=logout");
exit;
}
// create database object
$db = new db_manager(MYSQL_HOST,MYSQL_NAME,MYSQL_USER,MYSQL_PASS,"mysql","$xmpp_host");
// set user data
define(TOKEN,$sess->get('uid_l'));
$db->get_user_id(TOKEN);
define(USER_ID, $db->result->user_id);
if (!ctype_digit(USER_ID)) {
// exit on unexpected results
exit;
}
else{
$db->set_user_id(USER_ID);
}
// get parameters
$e_string=$_GET['a'];
if ($enc->decrypt_url($e_string) === true) {
$tslice = $enc->tslice;
$talker = $enc->peer_name_id;
$server = $enc->peer_server_id;
}
else {
// if validation of link fail, exit
header('Location: index.php');
exit;
}
$db->get_user_name($talker);
$user_name = $db->result->username;
$db->get_server_name($server);
$server_name = $db->result->server_name;
$nickname = $sess->get('export_nickname');
$db->get_own_name();
if ($db->result->own_name) {
$own_name = $db->result->own_name;
}
else{
$own_name = false;
}
// get chat
$db->get_user_chat($tslice,$talker,$server,$resource_id = null,$start = null,10000);
$result = $db->result;
// set headers
header("Cache-Control: public, must-revalidate");
header("Pragma: hack"); // this is WEIRD - it is needed to work with Internet Explorer :O
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"Jorge_chat_$nickname-$tslice.txt\"");
$data="$export_head1[$lang]$nickname ($user_name@$server_name) $export_head2[$lang] $tslice:\n";
foreach ($result as $results) {
if ($results["direction"] == "from")
{
$out=$nickname;
$tt=$tt+1;
$aa=0;
}
else
{
if ($own_name !== false) {
$out = $own_name;
}
else{
$out = TOKEN;
}
$aa=$aa+1;
$tt=0;
}
if ($aa<2 AND $tt<2) {
$data .= "\n(".trim(strstr($results[ts], ' ')).") $out\n";
$here="1";
}
else
{
$data .=""; $here="0";
}
$data .=" $results[body]\n";
}
$data .="\n\n______\nChat exported by Jorge";
echo $data;
ob_end_flush();
// log event
$db->set_logger("8","1", "JID: $user_name@$server_name, Date: $tslice");
$sess->unregister('export_nickname');
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -1,178 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require_once("headers.php");
require_once("upper.php");
$init = $_POST[init];
// header
$html->set_overview('<h2>'.$fav_main[$lang].'</h2><small>'.$fav_desc[$lang].'</small>');
// add to favorites
if ($init == "1") {
if ($enc->decrypt_url($_POST[a]) === true) {
$tslice = $enc->tslice;
$peer_name_id = $enc->peer_name_id;
$peer_server_id = $enc->peer_server_id;
$db->get_user_name($peer_name_id);
$user_name = $db->result->username;
$db->get_server_name($peer_server_id);
$server_name = $db->result->server_name;
$nick_name = query_nick_name($ejabberd_roster,$user_name, $server_name);
if (!$nick_name) {
$nick_name = $not_in_r[$lang];
unset($malpa);
}
else{
$malpa = "@";
}
$html->set_body('
<center>'.$fav_add[$lang].':<br>
<table class="ff" border="0" cellspacing="0">
<tr class="main_row_b"><td style="text-align: center;">'.$fav_chat[$lang].'<b>'.cut_nick($nick_name).'</b> (<i>'.$user_name.$malpa.$server_name.'</i>)</td></tr>
<form style="margin-bottom: 0;" action="favorites.php" method="post">
<tr><td colspan="3" align="center">
<textarea class="ccc" name="desc" rows="4">'.$my_links_optional[$lang].'</textarea>
</td></tr>
<tr><td colspan="3" align="center">
<input type="hidden" name="favorite" value="'.$_POST[a].'">
<input name="trigger" class="red" type="submit" value="'.$my_links_commit[$lang].'">
<input class="red" type="button" value="'.$my_links_cancel[$lang].'" onClick="parent.location=\''.$view_type.'?a='.$_POST[a].'\'">
</td></tr>
</form></table>
<hr size="1" noshade="noshade">
</center>');
}
}
// process request
if ($_POST[favorite]) {
if ($enc->decrypt_url($_POST[favorite]) === true) {
if ($db->set_favorites($enc->peer_name_id,$enc->peer_server_id,$peer_resource_id,$enc->tslice,$_POST[desc]) === true) {
$html->status_message($fav_success[$lang]);
}
else{
$html->alert_message($fav_error[$lang]);
}
}
}
// delete favorites
if ($_GET[del] == "t") {
if ($db->delete_favorites_id($_GET[link_id]) === true) {
$html->status_message($fav_removed[$lang]);
}
else{
$html->alert_message($oper_fail[$lang]);
}
}
// get favorites
$db->get_favorites();
if (count($db->result)>0) {
$html->set_body('
<center><table id="maincontent" class="ff" cellspacing="0">
<tr class="header"><td>'.$fav_when[$lang].'</td><td>'.$fav_contact[$lang].'</td><td>'.$fav_comment[$lang].'</td></tr>
<tr class="spacer" height="1px"><td colspan="4"></td></tr>
<tbody id="searchfield">
');
$fav_list = $db->result;
foreach ($fav_list as $row) {
$db->get_user_name($row[peer_name_id]);
$user_name = $db->result->username;
$db->get_server_name($row[peer_server_id]);
$server_name = $db->result->server_name;
$nickname = query_nick_name($ejabberd_roster,$user_name,$server_name);
$to_base = $enc->crypt_url("tslice=$row[tslice]&peer_name_id=$row[peer_name_id]&peer_server_id=$row[peer_server_id]");
if (!$row[comment] OR $row[comment] == $my_links_optional[$lang]) {
$comment = $fav_nocomm[$lang];
}
else{
$comment = htmlspecialchars($row[comment]);
$comment = str_replace("\n","<br>",$comment);
$comment = wordwrap($comment,30,"<br>",true);
}
if (!$nickname) {
$nickname = $not_in_r[$lang];
unset($malpa);
}
else {
$malpa = "@";
}
$html->set_body('
<tr style="cursor: pointer;" bgcolor="#e8eef7" onMouseOver="this.bgColor=\'c3d9ff\';" onMouseOut="this.bgColor=\'#e8eef7\';">
<td onclick="window.location=\''.$view_type.'?a='.$to_base.'&loc=3\';" style="padding-left: 10px; padding-right: 10px">'.verbose_date($row[tslice],$months_names,$weekdays).'</td>
<td onclick="window.location=\''.$view_type.'?a='.$to_base.'&loc=3\';" style="padding-left: 10px; padding-right: 10px">
<b>'.htmlspecialchars(cut_nick($nickname)).'</b> (<i>'.htmlspecialchars($user_name).$malpa.htmlspecialchars($server_name).'</i>)
</td>
<td onclick="window.location=\''.$view_type.'?a='.$to_base.'&loc=3\';" style="padding-left: 10px; padding-right: 10px;">'.$comment.'</td>
<td style="text-align: center;"><a href="favorites.php?del=t&link_id='.$row[link_id].'" onClick="if (!confirm(\''.$del_conf_my_link[$lang].'\')) return false;">&nbsp;'.$fav_remove[$lang].'&nbsp;</td>
</tr>
');
}
$html->set_body('</tbody><tr class="spacer"><td colspan="4"></td></tr><tr class="foot"><td colspan="4" height="15"></td></tr></table></center>');
}
else {
$html->status_message('<center><div class="message" style="width: 450px;">'.$fav_empty[$lang].'</div></center>');
}
require_once("footer.php");
?>

View File

@ -1,126 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
if (__FILE__==$_SERVER['SCRIPT_FILENAME']) {
header("Location: index.php?act=logout");
exit;
}
$location=$_SERVER['PHP_SELF'];
if ($location=="footer.php") {
header('Location: index.php?act=logout');
exit;
}
if (!preg_match("/index.php/i",$location)) {
$html->foot('<br><div align="right" style="clear: left;"><a href="http://dev.jabbim.cz/jorge/newticket" target="_blank">'.$quest1[$lang].'</a></div>');
}
$html->foot('
<br><div style="background-image: url(img/bell-down.png); height: 3px; background-repeat:repeat-x;"></div>
<div align="center">'.$links.'</div><br>
<div align="center" style="color: gray;">'.$copy.'</div>
<p style="font-size: xx-small; text-align: right;">v1.5-RC1</p><br>
');
// footer for admins...
$time_end = getmicrotime();
$time = substr($time_end - $time_start, 0, 10);
if (TOKEN==ADMIN_NAME) {
$html->foot('<small>'.$admin_site_gen[$lang].$time.'s.</small>');
};
// execude following code only when user is logged in
if (!preg_match("/index.php/i",$location) AND !preg_match("/not_enabled.php/i",$location)) {
$html->foot('
<script type="text/javascript">
$(document).ready(function() {
function format(mail) {
return mail.name + " &lt;" + mail.jid + "&gt";
}
$("#t_search").autocomplete([');
$ejabberd_roster->sort_by_jid("az");
$roster_auto = $ejabberd_roster->get_roster();
while(array_keys($roster_auto)) {
$jid = htmlspecialchars(key($roster_auto));
$nic = htmlspecialchars($roster_auto[$jid][nick]);
array_shift($roster_auto);
$html->foot('{ name: "'.$nic.'", jid:"'.$jid.'" },');
}
$html->foot('],
{
minChars: 1,
parse: function(data) {
return $.map(eval(data), function(row) {
return {
data: row,
value: row.name,
result: row.name + " <" + row.jid + ">"
}
});
},
formatItem:function(row, i, max, term) {
return row.name.replace(new RegExp("(" + term + ")", "gi"), "<strong>$1</strong>") + "<br><span style=\'font-size: 80%;\'>JabberID: &lt;" + row.jid + "&gt;</span>";
},
formatResult: function(row) {
return "from:" + row.jid;
},
multiple: false,
max: 10,
cacheLength: 200,
matchSubset: true,
selectFirst: true,
matchContains: true
}
).result(function(e, item) {
$("#content").append("<p>selected " + format(item) + "</p>");
});
});
</script>
');
}
$html->foot('</body></html>');
// render html output
$html->commit_render();
ob_end_flush();
?>

View File

@ -1,932 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
if (__FILE__==$_SERVER['SCRIPT_FILENAME']) {
header("Location: index.php?act=logout");
exit;
}
function get_user_agent($_SERVER) {
if (preg_match("/Macintosh/i",$_SERVER['HTTP_USER_AGENT'])) {
return true;
}
else{
return false;
}
return false;
}
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
function query_nick_name($ejabberd_roster,$talker, $server="") {
$nickname = $ejabberd_roster->get_nick("$talker"."@"."$server");
if ($nickname=="") {
$nickname=$talker;
}
return $nickname;
}
function validate_date($tslice) {
list($ye, $mo, $da) = split("-", $tslice);
return checkdate($mo,$da,$ye);
}
function check_registered_user ($sess,$ejabberd_rpc,$enc) {
if (!$sess->is_registered('uid_l') OR !$sess->is_registered('uid_p')) {
return false;
}
else {
if ($enc->decrypt_url($sess->get('uid_p')) === true) {
$uid_p = $enc->single;
}
else {
return false;
}
$ejabberd_rpc->set_user($sess->get('uid_l'),$uid_p);
if ($ejabberd_rpc->auth() === true) {
return true;
}
else {
return false;
}
}
return false;
}
function is_query_from($query) {
list($from,$talker,$query_p) = split(":",$query);
$from=trim($from);
if ($from=="from") {
$qquery[from] = "t";
$qquery[talker] = trim($talker);
$qquery[talker] = str_replace("//","@",$qquery[talker]); // hack for parametrized search
if ($query_p) {
$qquery[query] = $query_p;
$qquery[words] = "t";
return $qquery;
}
else {
$qquery[words] = "f";
return $qquery;
}
}
else {
// normal search
return "f";
}
}
function verbose_date($raw_date,$months_names = null,$weekdays = null,$t = false,$y = false) {
// English calendar arrays. Here we convert names from english calendar to other language. Make sure your locale in php work with default set to english.
$english_months = array("January","February", "March", "April", "May","June","July","August","September","October", "November","December");
$english_days = array("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
// Various formats
if ($t === true) {
return str_replace($english_days,$weekdays,strftime("%e.%m (%A)",strtotime("$raw_date")));
}
elseif($y === true) {
return str_replace($english_months,$months_names,strftime("%B %Y", strtotime("$raw_date")));
}
else{
return str_replace($english_months,$months_names,strftime("%e %B %Y", strtotime("$raw_date")));
}
}
function validate_start($start) {
if (!ctype_digit($start)) {
return false;
}
if (fmod($start,10)=="0") {
return true;
}
else {
return false;
}
}
function db_size() {
$result = mysql_query("show table status");
$size = 0;
while($row = mysql_fetch_array($result)) {
$size += $row["Data_length"];
}
$size = round(($size/1024)/1024, 1);
return $size;
}
function verbose_split_line($in_minutes,$verb_h,$in_min) {
if ($in_minutes>60) {
return $verb_h;
}
elseif ($in_minutes<60) {
return $in_minutes." ".$in_min;
}
}
function cut_nick($nick) {
if (strlen($nick)> 25) {
$nick=substr($nick,0,25)."...";
}
return $nick;
}
function new_parse_url($text) {
$text = ereg_replace("([[:alpha:]]+://www|[[:alpha:]]+://)[^<>[:space:]]+[[:alnum:]/]",
"<a class=\"clickl\" href=\"\\0\" target=\"_blank\">\\0</a>", $text);
// disabled for now
#$text = ereg_replace("[^://]?www[^<>[:space:]]+[[:alnum:]/]",
# "<a class=\"clickl\" href=\"http://\\0\" target=\"_blank\">\\0</a>", $text);
return $text;
}
function calendar($db,$user_id,$xmpp_host,$y,$m,$days,$token,$url_key,$left,$right,$selected,$lang,$view_type,$c_type,$name_peer=0,$server_peer=0,$cal_days=0,$enc=null,$months_names,$weekdays) {
$days=$days;
$month = $m;
$year = $y;
//create arrays for the calendar
$months_days = array("31","28","31","30","31","30","31","31",
"30","31","30","31");
$days_array = array("Mon","Tue","Wed","Thu","Fri","Sat","Sun");
//removes the 0 from start of month - can't find array key with 0
if(strlen($month)==1){
$month= str_replace("0","",$month);
}
else{
$month=$month;
}
//reset month to the array key match (array starts at 0)
$month= $month-1;
//find the days in the month
$days_in_month = $months_days[$month];
//$m is used to find month
$m = $month+1;
//find the first day of the month
$time = date("M D Y H:i:s", mktime(0, 0, 0, $m, 1, $year));
$first_day = explode(" ",$time);
$time = $first_day[1];
//create the links to next and previous months
$next = $month+2;
$x = $year;
//if month is 13 then new year
if($next==13){
$next=1;
$x = $x+1;
}
$prev = $month;
$y = $year;
//if month is 0, then previous year
if($prev==0){
$prev=12;
$y=$y-1;
}
$calendar = "";
//Build the calendar with css
//links to next and previous month only for browser
if ($c_type=="1") {
// encode links
$link_left = $enc->crypt_url("tslice=$y-$prev");
$link_right = $enc->crypt_url("tslice=$x-$next");
// check if we have chats in prev and next mo
$db->is_left_or_right("$y-$prev");
$i_left = $db->result;
$db->is_left_or_right("$x-$next");
$i_right = $db->result;
}
else {
$i_left=0;
$i_right=0;
}
$calendar .='
<table width="200" border="0" cellpadding="0" cellspacing="0" class="calbck">
<tr>
<td><img src="img/cal_corn_11.png" width="15" height="7" alt="cal_img"></td>
<td style="background-image: url(img/cal_bck_top.gif);"></td>
<td><img src="img/cal_corn_12.png" width="14" height="7" alt="cal_img"></td>
</tr>
<tr>
<td width="15" valign="top" class="calbckleft"><img src="img/cal_bck_left.png" width="15" height="116" alt="cal_img">
</td>
<td width="100%" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="15" align="center" class="caldays">
';
if ($i_left!=0) { $calendar.='<a href="?left='.$link_left.'"><<<</a>'; }
$verb_date = "$year-$m-1";
$calendar.='
&nbsp;</td>
<td colspan="5" align="center" class="calhead">'.verbose_date($verb_date,$months_names,$weekdays,false,true).'</td>
<td align="center" class="caldays">&nbsp;
';
if ($i_right!=0) { $calendar.='<a href="?right='.$link_right.'">>>></a>'; }
$calendar.='
</td>
</tr>
<tr align="center" class="calweek">
<td width="14%" height="15">'.$cal_days[$lang][1].'</td>
<td width="14%">'.$cal_days[$lang][2].'</td>
<td width="14%">'.$cal_days[$lang][3].'</td>
<td width="14%">'.$cal_days[$lang][4].'</td>
<td width="14%">'.$cal_days[$lang][5].'</td>
<td width="14%">'.$cal_days[$lang][6].'</td>
<td width="14%">'.$cal_days[$lang][7].'</td>
</tr>
';
//checks for leap years and add 1 to February
if(($year % 4 =="") && ($month==1)){
$days_in_month=$days_in_month+1;
}
else{
$days_in_month=$days_in_month;
}
$new_time="";
//find how many blank spaces at beginning of the month
foreach($days_array as $key=>$value){
if($value == $time){
$new_time .= $key+1;
}
else{
$new_time .="";
}
}
//loop through the days in the month
$c=0;
for($k=1;$k<($days_in_month+$new_time);$k++){
$c++;
if ($c==1) { $calendar.='<tr align="center" class="caldays">'; }
//blank space
if($k<$new_time){
$calendar.='<td height="15">&nbsp;</td>
';
continue;
}
//start the actual days
$n = $k-$new_time+1;
if(in_array($n,$days)){
if ($c_type=="1") {
$to_base = $enc->crypt_url("tslice=$year-$m-$n");
$loc_orign="";
}
elseif($c_type=="2") {
$to_base = $enc->crypt_url("tslice=$year-$m-$n&peer_name_id=$name_peer&peer_server_id=$server_peer");
$loc_orign="&amp;loc=2";
}
if ($selected==$n) { $bgcolor = 'bgcolor="#6daae7"'; } else { $bgcolor=""; }
$calendar .= '<td height="15" '.$bgcolor.' onclick="window.location=\''.$view_type.'?a='.$to_base.$loc_orign.'\'"><b><a class="caldays2" href="'.$view_type.'?a='.$to_base.$loc_orign.'">'.$n.'</a></b></td>
';
}
else{
$calendar .= '<td height="15">'.$n.'</td>
';
}
if ($c==7) { $calendar.='</tr>'; $c=0; }
}
$calendar .= '
</table>
</td>
<td width="14" valign="top" class="calbckright"><img src="img/cal_bck_right.png" width="14" height="116" alt="cal_img"></td>
</tr>
<tr>
<td><img src="img/cal_corn_21.png" width="15" height="16" alt="cal_img"></td>
<td style="background-image: url(img/cal_bck_bot.png);"></td>
<td><img src="img/cal_corn_22.png" width="14" height="16" alt="cal_img"></td>
</tr>
</table>
';
return($calendar);
}
function check_thread($db,$peer_name_id,$peer_server_id,$at,$xmpp_host,$dir=NULL) {
#adjust this hours as needed, we assume if chat is +/- 1 hour on the edge of day, then chat is related
if ($dir=="1") {
$day="+1 day";
$bhour="00:00:00";
$ehour="00:30:00";
}
elseif($dir=="2"){
$day="-1 day";
$bhour="23:30:00";
$ehour="23:59:59";
}
$get_date = date("Y-n-j", strtotime($day, strtotime(date("$at"))));
$db->check_thread($get_date,$peer_name_id,$peer_server_id,$bhour,$ehour);
if ($db->result > 0) {
return true;
}
else{
return false;
}
return false;
}
function check_rpc_server($rpc_arr,$rpc_port) {
foreach($rpc_arr as $rpc_host) {
// assume if response time is greater then 1 second RPC server is down
$fp=fsockopen("$rpc_host", $rpc_port, $errno, $errstr, 1);
if ($fp!=false) {
return $rpc_host;
}
}
return false;
}
function debug($debug=false,$string) {
if ($debug===true) {
print "<small>".htmlspecialchars($string)."</small><br>";
}
return;
}
function message_processor($tslice,$server_name,$start,$nickname,$result_messages,$db,$html,$enc,$token,$split_line,$lang_pack,$lang,$spec_mark,$e_string,$to_base_prev,$to_base_next) {
/*
This function perform message processing for message archives
tslice - date of chat
server_name - name of server
start - from what point of time of day should chat be displayed
nickname - peer nickname
result_messages - array of messages to be parsed
db - database object
html - html object
enc - encryption object
token - owner name
split_line - config option
lang_pack - array of translations
lang - language pack
spec_mark - marker used to distinguish what we are doing
e_string - url
*/
// Check if user have set up OwnName
$db->get_own_name();
if ($db->result->own_name) {
$own_name = $db->result->own_name;
}
else{
$own_name = false;
}
// Main loop
foreach($result_messages as $entry) {
// always get resource_id if message is type of groupchat
if ($entry[type] !== "groupchat") {
if ($resource_last !== $entry[peer_resource_id]) {
if ($db->get_resource_name($entry[peer_resource_id]) === false) {
return false;
}
$resource = $db->result->resource_name;
}
}
else{
if ($db->get_resource_name($entry[peer_resource_id]) === false) {
return false;
}
$resource = $db->result->resource_name;
}
$resource_last = $entry[peer_resource_id];
$licz++;
// marking messages
if ($entry["type"] === "chat" OR $entry["type"] == "") {
if ($entry["direction"] === "to") {
$col="main_row_a";
}
else {
$col="main_row_b";
}
}
elseif($entry["type"] === "error") {
$col="main_row_error";
}
elseif($entry["type"] === "normal") {
$col="main_row_message";
}
elseif($entry["type"] === "headline") {
$col="main_row_headline";
}
$ts = strstr($entry["ts"], ' ');
// time calc
$pass_to_next = $entry["ts"];
$new_d = $entry["ts"];
$time_diff = abs((strtotime("$old_d") - strtotime(date("$new_d"))));
$old_d = $pass_to_next;
// end time calc
if ($time_diff>$split_line AND $licz>1) {
$in_minutes = round(($time_diff/60),0);
$html->set_body('<tr class="splitl">
<td colspan="7" style="font-size: 10px;"><i>'.verbose_split_line($in_minutes,$lang_pack[7],$lang_pack[8]).'</i>
<hr size="1" noshade="noshade" style="color: #cccccc;"></td></tr>
');
}
// check if chat is continuation from previous day (work only for calendar view)
if ($to_base_prev !== NULL) {
if ($ts_mark!="1" AND substr($ts, 0 , strpos($ts, ":")) == 00 ) {
if ( check_thread($db,$talker,$server,$tslice,$xmpp_host,2) === true) {
$html->set_body('<tr><td colspan="6" style="text-align: left; padding-left: 5px;" class="message"><a href="calendar_view.php?a='.$to_base_prev.'">'.$lang_pack[0].'</a></td></tr>');
}
// check only first line
$ts_mark="1";
}
}
// run code only if type is not groupchat
if ($entry["type"] !== "groupchat") {
// setting subject
if ($col==="main_row_message" OR $col==="main_row_headline") {
if ($entry["subject"]) {
$subject = ": ".$entry["subject"];
}
else{
unset($subject);
}
}
// add line in case of special message
if ($col==="main_row_message") {
$html->set_body('<tr class="main_row_message"><td colspan="7" class="main_row_special">'.$lang_pack[1].' '.htmlspecialchars($subject).'</td></tr>');
}
if ($col==="main_row_error") {
$html->set_body('<tr class="main_row_error"><td colspan="7" class="main_row_special">'.$lang_pack[2].'</td></tr>');
}
if ($col==="main_row_headline") {
$html->set_body('<tr class="main_row_headline"><td colspan="7" class="main_row_special">'.$lang_pack[3].' '.htmlspecialchars($subject).'</td></tr>');
}
}
// calculate chat direction, whether to display nick...
if ($entry["direction"] == "from") {
$out=$nickname;
$tt=$tt+1;
$aa=0;
}
else{
$out = $token;
$aa=$aa+1;
$tt=0;
}
// timestamp, beginning of the chatline
if ($entry["type"] !== "groupchat") {
$html->set_body('<tr class="'.$col.'"><td class="time_chat" style="padding-left: 10px; padding-right: 10px;";>'.$ts.'</td>');
}
else{
if ($out!==$token) {
// colorize
if ($resource_group === $resource OR !$resource_group) {
if (!$col) {
$col = "main_row_group_to";
}
$col=$col;
}
else{
if($col === "main_row_group_from") {
$col="main_row_group_to";
}
else{
$col="main_row_group_from";
}
}
$html->set_body('<tr class="'.$col.'"><td class="time_chat" style="padding-left: 10px; padding-right: 10px;";>'.$ts.'</td>');
}
}
// different bahaviour for groupchat and other messages
if ($entry["type"] !== "groupchat") {
if ($aa<2 AND $tt<2) {
$html->set_body('<td style="padding-left: 5px; padding-right: 10px; nowrap="nowrap">');
if ($out === TOKEN) {
// display of Own Name
if ($own_name !== false) {
$html->set_body(cut_nick(htmlspecialchars($own_name)));
}
else{
$html->set_body(cut_nick(htmlspecialchars($out)));
}
}
else{
$html->set_body(cut_nick(htmlspecialchars($out)));
}
$html->set_body('<a name="'.$licz.'"></a>');
if ($out !== $token) {
if ($spec_mark === false) {
$html->set_body('
<br><div style="text-align: left; padding-left: 5px;">
<a class="export" id="pretty" title="'.$lang_pack[4].'" href="?a='.$e_string.'&amp;b='.$entry[peer_resource_id].'">
<small><i>'.cut_nick(htmlspecialchars($resource)).'</i></small></a></div>
');
}
else{
$html->set_body('<br><div style="text-align: left; padding-left: 5px;">
<small><i>'.cut_nick(htmlspecialchars($server_name)).'</i></small></div>
');
}
}
$html->set_body('</td>');
$here = "1";
}
else {
$html->set_body('<td style="text-align: right; padding-right: 5px">-</td>');
$here = "0";
}
}
else{
// do not display own chats sent to MUC. Here resource is actualy nickname as MUC standard specify
if ($out !== $token) {
if ($resource_group !== $resource) {
// if message is sent without resource, that must be channel message, advise user.
if ($resource === "") {
$resource = $lang_pack[5];
}
$html->set_body('<td style="padding-left: 5px; padding-right: 10px; nowrap="nowrap"><small>MUC: <i>'.cut_nick($out).'</i></small><a name="'.$licz.'"></a>
<br><div style="text-align: left; padding-left: 5px;">'.cut_nick(htmlspecialchars($resource)).'</div></td>
');
$here = "1";
$resource_group = $resource;
}
else{
$html->set_body('<td style="text-align: right; padding-right: 5px">-</td>');
$here = "0";
}
}
else{
$here = "0";
}
}
// process body part, do not show chat if message is type of groupchat
// this is sadly funny i write this 'if' and i dont know what exacly it do :/
if ($out !== $token OR $entry["type"] !== "groupchat") {
// prepare body
$new_s = htmlspecialchars($entry["body"]);
$to_r = array("\n");
$t_ro = array("<br>");
$new_s = str_replace($to_r,$t_ro,$new_s);
$new_s = wordwrap($new_s,107,"<br>",true);
$new_s = new_parse_url($new_s);
$html->set_body('<td width="800" colspan="3">'.$new_s.'</td>');
// generate mylink only on selected lines
if ($here==="1") {
$lnk = $enc->crypt_url("tslice=$tslice&peer_name_id=$entry[peer_name_id]&peer_server_id=$entry[peer_server_id]");
$to_base2 = $enc->crypt_url("tslice=$tslice&peer_name_id=$entry[peer_name_id]&peer_server_id=$entry[peer_server_id]&ismylink=1&linktag=$licz&lnk=$lnk&strt=$start");
$html->set_body('<td colspan="2" style="padding-left: 2px; font-size: 9px;"><a style="color: #1466bc" href="my_links.php?a='.$to_base2.'">'.$lang_pack[6].'</a></td>');
}
else {
$html->set_body('<td></td>');
}
if ($t=2) { $c=1; $t=0; } // WTF!?
$html->set_body('</tr>');
}
}
$html->set_body('</tbody>');
// Check thread. Work only for calendar view.
if ($to_base_next !== NULL) {
if (substr($ts, 0 , strpos($ts, ":")) == 23 AND date("Y-n-j") !== $tslice) {
if ( check_thread($db,$talker,$server,$tslice,$xmpp_host,1) === true) {
$html->set_body('<tr><td colspan="6" style="text-align: right; padding-right: 5px;" class="message"><a href="calendar_view.php?a='.$to_base_next.'">'.$lang_pack[9].'</a></td></tr>');
}
}
}
return true;
}
function is_language_supported($l_query,$language_support,$l_key = 0, $return_val = false) {
while (array_keys($language_support)) {
$lang_key = key($language_support);
if ($l_query === $language_support[$lang_key][$l_key]) {
if ($return_val === true) {
return $language_support[$lang_key][0];
}
else {
return true;
}
}
array_shift($language_support);
}
return false;
}
?>

View File

@ -1,371 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
if (__FILE__==$_SERVER['SCRIPT_FILENAME']) {
header("Location: index.php?act=logout");
exit;
}
// turn on buffering
ob_start();
// send headers
header("content-type: text/html; charset=utf-8");
// error reporting to off
error_reporting(E_NONE);
require_once("func.php"); // functions
require_once("class.sessions.php"); // sessions handling
require_once("class.ejabberd_xmlrpc.php"); // rpc class
require_once("class.db.php"); // db_manager
require_once("class.roster.php"); // roster
require_once("class.helper.php"); // helper
require_once("config.php"); // read configuration
# SSL redirection if set to true in config.
if (SSL_REDIRECT === "true") {
if($_SERVER['HTTPS'] != 'on') {
$url = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
header('Location: '.$url);
ob_end_flush();
exit;
}
}
$sess = new session;
// Language support. Well thats the hard way...
$language_found = false;
if ($_GET['lng_sw']) {
debug(DEBUG,"Setting language");
$c_language = is_language_supported($_GET['lng_sw'],$language_support,1,true);
if ($c_language !== false) {
setcookie("jorge_language",$c_language,time()+2592000);
$sess->set('language',$c_language);
debug(DEBUG,"Language found, loading file: $c_language.php");
require("lang/".$c_language.".php");
$language_found = true;
}
else{
setcookie("jorge_language",$language_support[default_language][0],time()+2592000);
$sess->set('language',$language_support[default_language][0]);
debug(DEBUG,"Language not found in selection, using defaults");
require('lang/'.$language_support[default_language][0].'.php');
}
}
// get client addr
$rem_adre = $_SERVER['REMOTE_ADDR'];
// something for mac users
$mac_user = get_user_agent($_SERVER);
// location
$location=$_SERVER['PHP_SELF'];
// init html helper
$html = new render_html();
if (!preg_match("/index.php/i",$location)) {
if ($sess->get('vhost') === null) {
header("Location: index.php?act=logout");
}
if (array_key_exists($sess->get('vhost'), $vhosts) === false) {
header("Location: index.php?act=logout");
}
define(XMPP_HOST,$sess->get('vhost'));
$rpc_host = check_rpc_server($vhosts[XMPP_HOST],$rpc_port);
debug(DEBUG,"Active RPC host: $rpc_host");
// in case no RPC servers are available stop jorge
if ($rpc_host===false) {
print "<br><center><b>Currently service is unavailable. Please try again later.</b><br>
<a href=\"index.php?act=logout\">Please logout</a>
</center>";
exit;
}
// create rpc object
$ejabberd_rpc = new rpc_connector("$rpc_host","$rpc_port",XMPP_HOST);
$xmpp_host = str_replace(".","_", XMPP_HOST);
}
else{
// check if selected host exist in configuration
if (array_key_exists($_POST['vhost'], $vhosts) === true) {
$rpc_host = check_rpc_server($vhosts[$_POST['vhost']],$rpc_port);
debug(DEBUG,"Selecting RPC server during login: $rpc_host");
if ($rpc_host === false) {
print "<br><center><b>Currently service is unavailable. Please try again later.<br>
<a href=\"index.php?act=logout\">Please logout</a>
</b></center>";
exit;
}
else {
define(XMPP_HOST,$_POST['vhost']);
$ejabberd_rpc = new rpc_connector("$rpc_host","$rpc_port",XMPP_HOST);
$xmpp_host = str_replace(".","_", XMPP_HOST);
}
}
else{
unset($_POST['inpLogin']);
unset($_POST['inpPass']);
// Try to recreate db object...
if ($_GET['act'] === "logout") {
if ($sess->get('vhost')!="") {
$xmpp_host = str_replace(".","_", $sess->get('vhost'));
}
}
}
}
// create db_manager object
$db = new db_manager(MYSQL_HOST,MYSQL_NAME,MYSQL_USER,MYSQL_PASS,"mysql","$xmpp_host");
$db->set_debug(SQL_DEBUG);
// create encryption object
$enc = new url_crypt(ENC_KEY);
// username (token)
define(TOKEN,$sess->get('uid_l'));
//debug
debug(DEBUG,"User session:".TOKEN);
// authentication checks. Ensure if session data is not altered... (only when we are inside Jorge)
if (!preg_match("/index.php/i",$location)) {
if (check_registered_user($sess,$ejabberd_rpc,$enc) !== true) {
header("Location: index.php?act=logout");
exit;
}
// Load language file based on current session
debug(DEBUG,"Selecting initial language after authentication");
if ($sess->get('language')) {
// Validate language setting in session
if (is_language_supported($sess->get('language'),$language_support) === true) {
debug(DEBUG,"Language selection ok.");
require('lang/'.$sess->get('language').'.php');
}
else{
debug(DEBUG,"Language in session was altered! Overwritting value...");
require('lang/'.$language_support[default_language][0].'.php');
$sess->set('language',$language_support[default_language][0]);
}
}
// we need user_id but only if we are not in not_enabled mode:
if(!preg_match("/not_enabled.php/i",$_SERVER['PHP_SELF'])) {
$db->get_user_id(TOKEN);
$user_id = $db->result->user_id;
// create user_id instance
$db->set_user_id($user_id);
}
}
// check if user have admin rights
if (in_array(TOKEN, $vhosts_admins[XMPP_HOST]) === true) {
define(ADMIN_NAME,TOKEN);
}
// run only for admins
if (TOKEN === ADMIN_NAME) {
$time_start=getmicrotime();
}
// If language not set or not found in cookie, set default language
if (preg_match("/index.php/i",$location) OR preg_match("/not_enabled.php/i",$location)) {
// Set defaults only if language was not selected
if ($language_found !== true) {
if (is_language_supported($_COOKIE["jorge_language"],$language_support) === true) {
debug(DEBUG,"Setting language according to cookie");
require('lang/'.$_COOKIE["jorge_language"].'.php');
$sess->set('language',$_COOKIE["jorge_language"]);
}
else {
debug(DEBUG,"Language cookie not found, using defaults");
require('lang/'.$language_support[default_language][0].'.php');
$sess->set('language',$language_support[default_language][0]);
}
}
}
// Get language from session
$lang=$sess->get('language');
$html->headers('
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<meta name="Author" content="Zbyszek Zolkiewski at jabster.pl">
<meta name="Keywords" content="jorge message archiving ejabberd mod_logdb erlang">
<meta name="Description" content="Jorge">
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="jquery.autocomplete.css" type="text/css">
<link rel="alternate" type="application/rss+xml" title="Project Jorge ChangeLog" href="https://jorge.jabster.pl/changelog.xml">
');
if (preg_match("/main.php/i",$location)) {
$html->headers('
<link rel="stylesheet" href="simpletree.css" type="text/css" />
<script type="text/javascript" src="lib/simpletreemenu.js">
/***********************************************
* Simple Tree Menu - Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
');
}
$html->headers('
<script type="text/javascript" src="lib/jquery.pack.js"></script>
<script type="text/javascript" src="lib/jquery.bgiframe.min.js"></script>
<script type="text/javascript" src="lib/jquery.tooltip.js"></script>
<script type="text/javascript" src="lib/jquery.quicksearch.js"></script>
<script type="text/javascript" src="lib/jquery.autocomplete.pack.js"></script>
');
// prevent loading includes as long as user is not admin.
if (TOKEN==ADMIN_NAME) {
$html->headers('<script language="javascript" type="text/javascript" src="lib/jquery.flot.pack.js"></script>');
}
$html->headers('
<title>Jorge Beta</title>
<script type="text/javascript">
$(function() {
$(\'table#maincontent tbody#searchfield tr\').quicksearch({
stripeRowClass: [\'odd\', \'even\'],
position: \'before\',
attached: \'#maincontent\',
labelText: \'QuickFilter:\',
loaderText: \'\',
inputClass: \'c_map_class\',
delay: 30
});
$(\'select#c_map option\').quicksearch({
stripeRowClass: [\'odd\', \'even\'],
position: \'before\',
inputText: \''.$filter_form_tip[$lang].'\',
inputClass: \'c_map_class\',
attached: \'#c_map_form\',
labelText: \''.$filter_form[$lang].':\',
delay: 30
});
$(\'img\').Tooltip();
$(\'a, tr, td\').Tooltip({
extraClass: "fancy",
showBody: ";",
showURL: false,
track: true,
fixPNG: true
});
});
</script>
</head>
<body style="background-image: url(img/bak2b.png); background-repeat:repeat-x; background-color: #edf5fa;">
<noscript>
<center><div style="background-color: #fad163; text-align: center; font-weight: bold; width: 500pt;">'.$no_script[$lang].'</div></center><br>
</noscript>
<script language="JavaScript1.2" type="text/javascript">
function smackzk() {
window.open(\'http://slimster.org/web\',\'\',
\'location=no,toolbar=no,menubar=no,scrollbars=no,resizable, height=375,width=715\');
}
</script>
');
?>

View File

@ -1,29 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require_once("headers.php");
require_once("upper.php");
$html->set_body('<h2>'.$help_but[$lang].'</h2><small>'.$help_notice[$lang].'</small>'.$help_search_tips[$lang].$help_my_links_note[$lang].$help_advanced_tips[$lang]);
require_once("footer.php");
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -1,384 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
// all we need is header.php file - be sure to include it in all Jorge files! as it containg authentication futures.
require_once("headers.php");
require_once("lib/recaptchalib.php");
// if already logged in (session active), move to main screen according to user preferences
if ($sess->get('uid_l')) {
if ($sess->get('view_type') == "1") {
header ("Location: main.php");
}
else {
header ("Location: calendar_view.php");
}
}
// get post data
$inpLogin = strtolower($_POST['inpLogin']);
$inpPass = $_POST['inpPass'];
if ($wo_sess || $inpLogin || $inpPass) {
// set attepts in cookies
if ($_COOKIE["auth_attempt"]=="") {
// show captcha anyway if user comes for the first time or have disabled cookies
setcookie("auth_attempt",1,time()+600);
$auth_attempt = "3";
}
else{
$auth_attempt = $_COOKIE["auth_attempt"] + 1;
settype($auth_attempt,"string");
// if it is not numeric let set it to some high value
if (!ctype_digit($auth_attempt)) {
$auth_attempt = "100";
}
setcookie("auth_attempt",$auth_attempt,time()+600);
}
// on 3rd attempt - check captcha
if ($auth_attempt >= "3") {
$resp = recaptcha_check_answer(CAPTCHA_PRIVATE,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
unset($inpPass);
unset($inpLogin);
$html->system_message($wrong_data2[$lang]);
}
}
}
if ($_GET['act']==="logout") {
if ($db->get_user_id(TOKEN) === true) {
if($db->result->user_id) {
$db->set_user_id($db->result->user_id);
$db->set_logger("2","1",$rem_adre);
}
}
$sess->finish();
header("Location: index.php");
exit;
}
else {
if ($inpLogin!="" || $inpPass!="") {
$ejabberd_rpc->set_user($inpLogin,$inpPass);
if ($ejabberd_rpc->auth() === true) {
$sess->set('login',$inpLogin);
$sess->set('uid_l',$inpLogin);
$sess->set('uid_p',$enc->crypt_url("single=$inpPass"));
$sess->set('vhost',XMPP_HOST);
// remember user choice
setcookie("fav_host", XMPP_HOST,time()+2592000);
setcookie("auth_attempt",0,time()+2592000);
// Get user_id if it is possible
if ($db->get_user_id($sess->get('uid_l')) === true) {
$ui = $db->result->user_id;
$db->set_user_id($ui);
$db->is_log_enabled();
$ret_v = $db->result->is_enabled;
}
else {
$ret_val = null;
}
if ($ret_v === true OR $ret_v === false) {
$sess->set('log_status',$ret_v);
$db->set_logger("1","1",$rem_adre);
// get preferences, if not set, fallback to standard view.
$db->get_jorge_pref();
$pref_res = $db->result;
foreach ($pref_res as $res_pref) {
if ($res_pref[pref_id]=="1") {
if ($res_pref[pref_value] == "2") {
$view_type = "2";
$tmp_v = "calendar_view.php";
}
elseif($res_pref[pref_value] == "1") {
$view_type = "1";
$tmp_v = "main.php";
}
$sess->set('view_type',$view_type);
}
if ($res_pref[pref_id] == "2") {
// Check if language is supported, return value if it is
$check_language = is_language_supported($res_pref[pref_value],$language_support,1,true);
// function can return true/false/value, in this case we need value and not false
if ($check_language !== false) {
// set language according to database setup
setcookie("jorge_language",$check_language,time()+2592000);
$sess->set('language',$check_language);
}
else{
// this is where language was not found in settings, so use default
setcookie("jorge_language",$language_support[default_language][1],time()+2592000);
$sess->set('language',$check_language);
}
}
}
if ($tmp_v=="") {
$sess->set('view_type',2);
$tmp_v="calendar_view.php";
}
header("Location: $tmp_v");
exit; // lets break script at this point...
}
else {
$sess->set('log_status',null);
header("Location: not_enabled.php");
exit;
}
}
if (no_vhost === true) {
$html->system_message($vhost_not_selected[$lang]);
}
else{
$html->system_message($wrong_data[$lang]);
}
$db->get_user_id($inpLogin);
$ui_fail = $db->result->user_id;
// Workaround, if user_id is not know, do not alter login attempts
if ($ui_fail) {
$db->get_last_attempt($ui_fail);
$row = $db->result->cnt;
}
else{
$row="0";
}
// bump log_level if more then 3 log attempts in one minute
if ($row > "3") {
$log_level = "3";
}
else {
$log_level = "2";
}
if ($ejabberd_rpc->check_account() === true) {
$db->set_user_id($ui_fail);
$db->set_logger("3",$log_level,$rem_adre);
}
}
}
$html->set_body('
<script type="text/javascript">
var RecaptchaOptions = {
theme : \'clean\'
};
</script>
');
$html->set_body('
<br><div align="center" style="height: 110;"><br><a href="index.php"><img border="0" alt="Branding logo" src="img/'.$brand_logo.'"></a></div>
<table class="ff" cellspacing="0" width="100%">
<tr style="background-image: url(img/bell-bak.png); height: 24;">
<td style="text-align: left; padding-left: 10px; color: white;">'.$welcome_1[$lang].'</td>
</tr>
<tr>
<td style="text-align: right;">
<form name="language_selector" action="index.php" method="get">
<select class="cc" name="lng_sw" onchange="javascript:document.language_selector.submit();">
');
// Get supported languages.
while (array_keys($language_support)) {
$lang_key = key($language_support);
if ($sess->get('language') === $language_support[$lang_key][0]) {
$pol_sel="selected";
}
else{
unset($pol_sel);
}
$html->set_body('<option '.$pol_sel.' value="'.$language_support[$lang_key][1].'">'.$lang_key.'</option>');
array_shift($language_support);
}
$html->set_body('</select>
</form>
</td>
</tr>
</table>
<center>
<form action="index.php" method="post">
<br><br>
<table class="ff" border="0" cellspacing="0" cellpadding="0">
<tr><td align="right">'.$login_w[$lang].'&nbsp;</td><td><input name="inpLogin" value="'.$_POST['inpLogin'].'" class="log" >
');
// vhost support
$vhost_count = count($vhosts);
if ($vhost_count>1) {
$html->set_body('<select name="vhost">
<option value="null">'.$vhost_select[$lang].'</option>
');
while (array_keys($vhosts)) {
$vhost = key($vhosts);
if ($_POST['vhost'] == $vhost OR $_COOKIE['fav_host'] == $vhost) {
$selected_vhost="selected=\"selected\"";
}
else {
unset($selected_vhost);
}
$html->set_body('<option value="'.$vhost.'" '.$selected_vhost.'>'.$vhost.'</option>');
array_shift($vhosts);
}
$html->set_body('</select>');
}
else{
// There is only one vhost configured, so do not display select box
$html->set_body('@'.key($vhosts).'<input type="hidden" name="vhost" value="'.key($vhosts).'">');
}
$html->set_body('</td></tr>
<tr style="height: 3pt;" ><td></td></tr>
<tr><td align="right">'.$passwd_w[$lang].'&nbsp;</td><td><input name="inpPass" type="password" class="log"></td></tr>
<tr style="height: 10pt;"><td></td></tr>
');
// display captcha on 3rd attempt...
$check_cookie = $_COOKIE["auth_attempt"];
settype($check_cookie,"string");
if (!ctype_digit($check_cookie) OR $check_cookie=="") {
$cookie_failed = true;
}
else{
$cookie_failed = false;
}
if ($check_cookie >= "2" OR $cookie_failed === true) {
$html->set_body('<tr><td colspan="2">'.recaptcha_get_html(CAPTCHA_PUBLIC,$error = null, $use_ssl = true).'</td></tr>
<tr style="height: 15;"><td></td></tr>');
}
$html->set_body('<tr><td colspan="2" align="right"><input type="submit" name="sublogin" value="'.$login_act[$lang].'"></td></tr>
</table></form></center>
');
require_once("footer.php");
?>

View File

@ -1,182 +0,0 @@
-- MySQL schema for project Jorge
--
-- Table structure for table `jorge_favorites`
--
DROP TABLE IF EXISTS `jorge_favorites`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `jorge_favorites` (
`owner_id` int(11) default NULL,
`peer_name_id` int(11) default NULL,
`peer_server_id` int(11) default NULL,
`resource_id` int(11) default NULL,
`tslice` varchar(20) default NULL,
`comment` varchar(50) default NULL,
`ext` int(11) default NULL,
`link_id` int(10) unsigned NOT NULL auto_increment,
`vhost` varchar(255) default NULL,
PRIMARY KEY (`link_id`),
KEY `jorge_favorites_ext_idx` (`owner_id`,`ext`),
KEY `favorites_idx` (`owner_id`,`peer_name_id`,`peer_server_id`,`tslice`,`vhost`)
) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `jorge_logger`
--
DROP TABLE IF EXISTS `jorge_logger`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `jorge_logger` (
`id_user` int(11) default NULL,
`id_log_detail` int(11) default NULL,
`id_log_level` int(11) default NULL,
`log_time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`extra` text,
`vhost` varchar(255) default NULL,
KEY `logger_idx` (`id_user`,`id_log_detail`,`id_log_level`,`vhost`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `jorge_logger_level_dict`
--
DROP TABLE IF EXISTS `jorge_logger_level_dict`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `jorge_logger_level_dict` (
`id_level` smallint(6) NOT NULL,
`level` varchar(20) default NULL,
`lang` varchar(3) NOT NULL default '',
PRIMARY KEY (`id_level`,`lang`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `jorge_logger_dict`
--
DROP TABLE IF EXISTS `jorge_logger_dict`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `jorge_logger_dict` (
`id_event` smallint(6) NOT NULL,
`event` text,
`lang` varchar(3) NOT NULL default 'eng',
PRIMARY KEY (`id_event`,`lang`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `jorge_mylinks`
--
DROP TABLE IF EXISTS `jorge_mylinks`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `jorge_mylinks` (
`id_link` int(11) NOT NULL auto_increment,
`owner_id` int(11) default NULL,
`peer_name_id` int(11) default NULL,
`peer_server_id` int(11) default NULL,
`datat` text,
`link` text,
`description` text,
`ext` int(11) default NULL,
`link_id` int(11) default NULL,
`vhost` varchar(255) default NULL,
PRIMARY KEY (`id_link`),
KEY `mylinks_idx` (`owner_id`,`vhost`)
) ENGINE=InnoDB AUTO_INCREMENT=454 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `jorge_pref`
--
DROP TABLE IF EXISTS `jorge_pref`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `jorge_pref` (
`owner_id` int(11) default NULL,
`pref_id` int(11) default NULL,
`pref_value` int(11) default NULL,
`vhost` varchar(255) default NULL,
KEY `pref_idx` (`owner_id`,`vhost`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `jorge_stats`
--
DROP TABLE IF EXISTS `jorge_stats`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `jorge_stats` (
`day` date default NULL,
`hour` tinyint(4) default NULL,
`value` int(11) default NULL,
`vhost` varchar(255) default NULL,
KEY `stats_idx` (`day`,`vhost`),
PRIMARY KEY (`day`,`hour`,`vhost`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `pending_del`
--
DROP TABLE IF EXISTS `pending_del`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pending_del` (
`owner_id` int(11) default NULL,
`peer_name_id` int(11) default NULL,
`date` varchar(20) default NULL,
`peer_server_id` int(11) default NULL,
`timeframe` timestamp NOT NULL default CURRENT_TIMESTAMP,
`type` enum('chat','favorite','mylink','other') default NULL,
`idx` smallint(6) default NULL,
`vhost` varchar(255) default NULL,
KEY `pending_idx` (`owner_id`,`peer_name_id`,`peer_server_id`,`date`,`type`,`idx`,`vhost`),
KEY `pending_time_idx` (`timeframe`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `jorge_self_names`
--
DROP TABLE IF EXISTS `jorge_self_names`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `jorge_self_names` (
`owner_id` int(11) NOT NULL,
`own_name` varchar(60) NOT NULL,
`vhost` varchar(255) NOT NULL,
PRIMARY KEY (`owner_id`,`vhost`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Inserting logger dictionary
--
LOCK TABLES `jorge_logger_dict` WRITE;
/*!40000 ALTER TABLE `jorge_logger_dict` DISABLE KEYS */;
INSERT INTO `jorge_logger_dict` VALUES (1,'Logged in','eng'),(2,'Logged out','eng'),(3,'Login failed','eng'),(4,'Deleted chat thread','eng'),(5,'Deleted whole archive','eng'),(6,'Turned off archivization','eng'),(7,'Turned on archivization','eng'),(8,'Chat exported','eng'),(9,'Deleted entire archive','eng');
/*!40000 ALTER TABLE `jorge_logger_dict` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `jorge_logger_level_dict` WRITE;
/*!40000 ALTER TABLE `jorge_logger_level_dict` DISABLE KEYS */;
INSERT INTO `jorge_logger_level_dict` VALUES (1,'normal','eng'),(2,'warn','eng'),(3,'alert','eng');
/*!40000 ALTER TABLE `jorge_logger_level_dict` ENABLE KEYS */;
UNLOCK TABLES;
-- EOF

View File

@ -1,48 +0,0 @@
.ac_results {
padding: 0px;
border: 1px solid black;
background-color: white;
overflow: hidden;
z-index: 99999;
}
.ac_results ul {
width: 100%;
list-style-position: outside;
list-style: none;
padding: 0;
margin: 0;
}
.ac_results li {
margin: 0px;
padding: 2px 5px;
cursor: default;
display: block;
/*
if width will be 100% horizontal scrollbar will apear
when scroll mode will be used
*/
/*width: 100%;*/
font: menu;
font-size: 12px;
/*
it is very important, if line-height not setted or setted
in relative units scroll will be broken in firefox
*/
line-height: 16px;
overflow: hidden;
}
.ac_loading {
background: white url('img/indicator.gif') right center no-repeat;
}
.ac_odd {
background-color: #eee;
}
.ac_over {
background-color: #0A246A;
color: white;
}

View File

@ -1,44 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
// WARNING: File encoding is UTF-8 and should remain in this encoding!
if (__FILE__==$_SERVER['SCRIPT_FILENAME']) {
header("Location: index.php?act=logout");
exit;
}
/*
This file contains some core messages - language independent
*/
?>

View File

@ -1,329 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
// WARNING: File encoding is UTF-8 and should remain in this encoding!
if (__FILE__==$_SERVER['SCRIPT_FILENAME']) {
header("Location: index.php?act=logout");
exit;
}
$vhost_select[eng] = "Select server";
$vhost_not_selected[eng] = "No server have been selected!";
$no_script[eng] = "Your browser dont support Javascript. Jorge require to have Javascript enabled!";
$act_su[eng] = "Message archiving activated succesfuly!";
$wrong_data[eng] = "Bad username or password!";
$wrong_data2[eng] = "You have entered wrong word from picture, try again";
$act_su2[eng] = "You must relogin to system";
$act_info[eng] = "Message archiving is not activated for user: ";
$warning1[eng] = "System discovered that you dont have profile yet, profile is required to work with Jorge. Create your profile now.<br>
WARNING - We are still testing the system, that mean it may not work at all or work wrong or even lead to datalost. Use it at your own risk!";
$welcome_1[eng] = "Welcome to Jorge - message archives. Please login";
$login_w[eng] = "Login";
$passwd_w[eng] = "Password";
$login_act[eng] = "Sign in";
$devel_info[eng] = "Development version";
$activate_m[eng] = "Enable message archiving";
$ch_lan[eng] = "Change language to:";
$ch_lan2[eng] = "Zmień język na ";
$lang_sw[eng] = "Polski";
$lang_sw2[eng] = "Angielski";
$header_l[eng] = "Message archives of server";
$menu_item_browser[eng] = "Browser";
$menu_item_map[eng] = "Chat Map";
$menu_item_fav[eng] = "Favorites";
$menu_item_search[eng] = "Search";
$menu_item_links[eng] = "MyLinks";
$menu_item_panel[eng] = "Control Panel";
$menu_item_contacts[eng] = "Contacts";
$menu_item_logs[eng] = "Logs";
$menu_item_trash[eng] = "Trash";
$filter_form[eng] = "Filter your contacts<span style=\"vertical-align: super;\"><small> *</small></span>";
$filter_form_tip[eng] = "Type contact name";
$filter_tip[eng] = "...and next select it from list, or search contact list by hand:";
$ff_notice[eng] = "This function work only in Firefox browser";
$search_box[eng] = "Search in archives";
$search_tip[eng] = "Displaying";
$search_why[eng] = " search results (<i>not more then 100</i>). <a href=\"help.php#22\" target=\"_blank\"><u>Find out why</u></a>";
$search_warn[eng] = "Warning: Showing results only from selected time range";
$all_for_u[eng] = "Show conversations with this user using: ";
$all_for_u_m[eng] = "stream";
$all_for_u_m_d[eng] = "Show all conversations with this user as stream";
$all_for_u_m2[eng] = "map";
$all_for_u_m2_d[eng] = "Show all conversations with this user as chat map";
$all_for_u_t[eng] = "Show all chats from this user";
$arch_on[eng] = "Turn on archivization";
$arch_off[eng] = "Turn off archivization";
$log_out_b[eng] = "Sign out";
$archives_t[eng] = "Archive browser";
$main_date[eng] = "Date:";
$talks[eng] = "Conversation list:";
$thread[eng] = "Content:";
$time_t[eng] = "Time:";
$user_t[eng] = "User:";
$my_links_save[eng] = "MyLinks";
$my_links_desc_m[eng] = "MyLinks - Your links";
$my_links_desc_e[eng] = "Here you can find saved fragments of your chats";
$settings_desc[eng] = "Archive settings";
$settings_desc_detail[eng] = "The panel consist of options that let you control message archiving as well as options regarding your account";
$api_access_enable[eng] = "Enable API access for this account";
$api_access_disable[eng] = "Disable API access for this account";
$api_access_off[eng] = "API access is enabled for this account";
$api_access_learn[eng] = "Learn more about public API";
$print_t[eng] = "print";
$del_t[eng] = "delete";
$resource_only[eng] = "Show chat only with this resource";
$resource_warn[eng] = "Showing chat only with resource: ";
$resource_discard[eng] = "Show ";
$resource_discard2[eng] = "entire chat thread.";
$del_all_conf[eng] = "You are about to delete all your message archives. Are you *really* sure?\\nWARNING: It would be impossible to recover your archives!";
$deleted_all[eng] = "All your message archive has been deleted";
$delete_nothing[eng] = "Your message archive is empty. Nothing was deleted";
$delete_error[eng] = "Ooops...There were errors during processing your request. Please try again later";
$search_w1[eng] = "Search string cannot be shorter than 3 and longer than 70 characters...";
$search_res[eng] = "Search results: ";
$my_links_save_d[eng] = "Saving link. Fill the form below";
$my_links_optional[eng] = "Description (optional, max 120 characters)";
$my_links_chat[eng] = "Conversation with:";
$my_links_commit[eng] = "save";
$my_links_cancel[eng] = "cancel";
$my_links_link[eng] = "Link from day:";
$my_links_desc[eng] = "Description:";
$my_links_added[eng] = "Link succesfuly added!";
$my_links_back[eng] = "Back to chat";
$my_links_removed[eng] = "Link succesfuly deleted";
$my_links_none[eng] = "No decsription";
$status_msg1[eng] = "Message archiving is disabled by user";
$status_msg2[eng] = "Message archiving have beed enabled. Changes may take 10s";
$status_msg3[eng] = "Message archiving have beed disabled. Changes may take 10s";
$my_links_no_links[eng] = "You don't have any MyLinks saved...";
$quest1[eng] = "Found error? Fill bug report!";
$search1[eng] = "Search...";
$no_result[eng] = "No search results";
$settings_del[eng] = "Delete entire archive";
$del_conf[eng] = "Do you really want to delete this chat?";
$del_conf_my_link[eng] = "Do you really want to remove that link?";
$not_in_r[eng] = "Special contact";
$del_moved[eng] = "Conversation moved to trash.";
$del_info[eng] = "Conversation have been deleted";
$undo_info[eng] = "Conversation restored succesfuly";
$del_my_link[eng] = "delete";
$help_but[eng] = "Help";
$tip_delete[eng] = "Delete this conversation";
$tip_export[eng] = "Export this conversation to text file";
$customize1[eng] = "Customize logging";
$from_u[eng] = "From: ";
$to_u[eng] = "To: ";
$search_next[eng] = "Next results...";
$search_prev[eng] = "Previous results...";
$change_pass[eng] = "Change password";
$no_contacts[eng] = "Your contacts list is currently empty";
$no_archives[eng] = "Currently you dont have any chats saved";
$con_tab1[eng] = "No.";
$con_tab2[eng] = "Contact name";
$con_tab3[eng] = "JabberID";
$con_tab4[eng] = "Enable archiving";
$con_tab_act_y[eng] = "Yes";
$con_tab_act_n[eng] = "No";
$con_tab_submit[eng] = "Save changes";
$con_tab6[eng] = "Group";
$con_no_g[eng] = "No group";
$map_no_g[eng] = "no group";
$con_head[eng] = "Contacts managment";
$con_notice[eng] = "Notice: displaying only contacts with assigned nicknames.";
$con_title[eng] = "Click on contact name to see conversation history";
$con_saved[eng] = "Changes have beed saved";
$help_notice[eng] = "Main topics";
$nx_dy[eng] = "Next day";
$no_more[eng] = "No more search results";
$in_min[eng] = "minutes";
$verb_h[eng] = "interruption in conversation lasting more than an hour";
$time_range_w[eng] = "Field \"From\" cannot be greater than field \"To\"";
$time_range_from[eng] = "from";
$time_range_to[eng] = "to";
$export_link[eng] = "export";
$export_head1[eng] = "Exported chat between you and ";
$export_head2[eng] = "performed on";
$help_search_tips[eng] ="
<br/><br/>
<li>Search Tips</li>
<ul>When searching you can do some more complex queries like:<br />
if you want to find all chats from particular user you can type:<br />
<b>from:jid@example.com</b> - where <i>jid</i> is user name of the server: <i>example.com</i><br />
or if you want to find phase in chats with that user, you can type:<br />
<b>from:jid@example.com:what is jabber</b> - witch will query for phase <i>what is jabber</i> in all chats with user <i>jid@example.com</i><br />
Search engine also of course supports normal search that search all archives:<br />
<b>what is jabber</b> - will search in all our chats phase \"what is jabber\" as well as all keywords like: \"what\", \"is\", \"jabber\"<br />
If we don't know full name that we are searching we can put instead character: * (wildcard):<br />
<b>wor*</b> - will find all words that begin with wor* like: word, work, world...
</ul>
";
$help_my_links_note[eng] = "
<br/><br/>
<li>MyLinks: overview.</li>
<ul>MyLinks let you store your favorited links. Thanks to MyLinks option you can easly and fast find your favorited talk.<br />
To add chat to MyLinks just click on the right side of the chat window onto option called \"save in mylinks\". Then fill the form with description and save link into database.
</ul>
";
$help_advanced_tips[eng] = "
<br/><br/>
<li>How to search right</li>
<ul>Search engine of <b>Jorge</b> supports advanced mode called <i>Boolean mode</i>, that means that you can improve your search results.</br>
Search engine search all your archives next it sort it and evaluates score and then displays only 100 most relevant matches.<br/>
To let you make it easy to adjust search results engine supports following arguments:<br/>
<b>+</b> - means that particular word must be in the results, so: +abc +def means that both words must be there<br/>
<b>-</b> - it excludes word from search results<br/>
<b>></b> and <b><</b> - increasese or decreases score for particular word</br>
<b>( )</b> - make it possible to execute sub-query</br>
<b>~</b> - adds negative score to particular word</br>
<b>*</b> - replaces unknown word</br>
<b>\"</b> - perform exact match search</br>
</ul>
";
$admin_site_gen[eng] = "Site generated in:";
$logger_from_day[eng] = " from day: ";
$logger_overview[eng] = "Activity logs on Jorge";
$logger_f1[eng] = "Event:";
$logger_f2[eng] = "Event date:";
$logger_f3[eng] = "Event level:";
$logger_f4[eng] = "Additional info:";
$logger_f_ip[eng] = "from IP address: ";
$refresh[eng] = "Refresh";
$back_t[eng] = "Back to top of the page";
$trash_name[eng] = "Trash";
$trash_desc[eng] = "List of trashed conversations. Conversations that are left in trash are automaticly deleted after 30 days.";
$trash_undel[eng] = "Restore";
$trash_vit[eng] = "View restored chat";
$trash_del[eng] = "Delete";
$trash_link[eng] = "Action";
$trash_empty[eng] = "Trash is empty";
$trash_recovered[eng] = "Conversation have been moved to archive";
$cal_head[eng] = "Chat calendar";
$cal_notice[eng] = "Click on days to see chats";
$change_view[eng] = "Switch to tree view";
$change_view_cal[eng] = "Browse archives using calendar view.";
$months_names = array("January","February","March","April","May","June","July","August","September","October","November","December");
$weekdays = array("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
$jump_to_l[eng] = "Select month";
$chat_list_l[eng] = "Conversation list:";
$select_view[eng] = "Select prefered view for browser:";
$view_calendar[eng] = "Calendar view";
$view_standard[eng] = "Tree view";
$setting_d1[eng] = "Change global archivization policy:";
$setting_d2[eng] = "Delete entire message archive (<i>cannot undo</i>):";
$chat_map[eng] = "Chat map";
$chat_select[eng] = "Select contact to see chats";
$chat_m_select[eng] = "Pick a contact:";
$chat_c_list[eng] = "Contacts list";
$chat_no_chats[eng] = "There are no chats with selected contact";
$chat_map_back[eng] = "<<< Back to ChatMap";
$fav_back[eng] = "<<< Back to Favorites";
$myl_back[eng] = "<<< Back to MyLinks";
$sel_language[eng] = "Select prefered language";
$sel_client[eng] = "Launch Slimster";
$sel_yes[eng] = "Yes";
$sel_no[eng] = "No";
$jump_to_next[eng] = "Go to next conversation with this user";
$jump_to_prev[eng] = "Go to to previous conversation with this user";
$show_chats[eng] = "Show chat as";
$show_chat_stream[eng] = "stream";
$show_chat_as_map[eng] = "map";
$tip_next_m[eng] = "Go to next month";
$tip_prev_m[eng] = "Go to previous month";
$cal_days[eng]['1'] = "Mon";
$cal_days[eng]['2'] = "Tue";
$cal_days[eng]['3'] = "Wed";
$cal_days[eng]['4'] = "Thu";
$cal_days[eng]['5'] = "Fri";
$cal_days[eng]['6'] = "Sat";
$cal_days[eng]['7'] = "Sun";
$chat_lines[eng] = "Messages count: ";
$del_time[eng] = "Deleted:";
$marked_as_d[eng] = "This chat is in trash. If you want to see it - <a href=\"trash.php\"><u>restore it</u></a>";
$stats_personal_d[eng] = "Personal statistics";
$stats_personal[eng] = "Your total number of messages in archiwe:";
$stats_personal_top[eng] = "Your top 10 chats:";
$stats_when[eng] = "When";
$stats_personal_count[eng] = "Messages count";
$stats_peer[eng] = "Talker";
$stats_see[eng] = "See this chat";
$stats_for[eng] = "Stats for: ";
$stats_messages[eng] = "Messages logged by server: ";
$stats_messages_b[eng] = " in ";
$stats_messages_c[eng] = " conversations.";
$stats_graph1[eng] = "Total number of users using message archiving (daily)";
$stats_graph2[eng] = "Messages logged by server (daily)";
$stats_graph3[eng] = "Messages logged (hourly)";
$stats_graph4[eng] = "Messages logged (weekly)";
$stats_top[eng] = "Longest conversations from last days:";
$stats_not_eno[eng] = "Not enought data to plot the graphs (<i>30 days needed</i>)";
$fav_main[eng] = "Favorites";
$fav_desc[eng] = "List of chats marked as favorites";
$fav_add[eng] = "Add conversation to favorites";
$fav_chat[eng] = "Conversation with: ";
$fav_success[eng] = "Conversation has been succesfully added to your <i>Favorites</i> !";
$fav_discard[eng] = "Discard this message";
$fav_exist[eng] = "Ooops...This chat is already in your <i>Favorites</i>";
$fav_favorited[eng] = "This conversation is already added to favorites";
$fav_contact[eng] = "Conversation with:";
$fav_when[eng] = "When:";
$fav_comment[eng] = "Comment:";
$fav_nocomm[eng] = "No comment";
$fav_add_comment[eng] = "Add comment";
$fav_remove[eng] = "delete";
$fav_removed[eng] = "Conversation has been deleted from <i>Favorites</i>";
$fav_empty[eng] = "You dont have any <i>Favorites</i> chats saved";
$fav_error[eng] = "Oooups...There was a problem during processing your request";
$reset_sort[eng] = "reset sorting";
$cont_chat[eng] = "chat continues on next day >>>";
$cont_chat_p[eng] = "<<< this chat is continuation from last day";
$close_account[eng] = "Close your account:";
$close_info[eng] = "WARNING: during account removal also account on Google Apps will be removed!";
$close_warn[eng] = "Do you really want to remove all messages and user account?";
$close_commit[eng] = "- Close now -";
$close_failed[eng] = "Close account failed. Please try again later";
$oper_fail[eng] = "<center><b>Operation failed! Please try again later or contact administrator!</b></center>";
$go_to_jorge[eng] = "Go to Jorge main page";
$qlink_l[eng] = "Go to latest conversations";
$message_type_message[eng] = "Message";
$message_type_error[eng] = "Message have been marked as faulty, and probably was not delivered.";
$message_type_headline[eng] = "Headline";
$muc_message[eng] = "System message:";
$spec_contact_enable[eng] = "Display special contact:";
$spec_contact_desc[eng] = "This option let you decide if conversations with special contacts like gateways, transports are displayed in your chat list. Most users can say <i>No</i> here.";
$donate[eng] = "<small>Help develop Project Jorge.<a href=\"http://www.planeta.toliman.pl/2008/10/donate-project-jorge.html\" target=\"_blank\"><u>Read More...</u></a></small>";
$donate_dont[eng] = "<small>Don't show this information anymore...</small>";
$own_name_desc[eng] = "This option allows to display your name as you wish: f.e. <i>james0021a</i> is replaced with <i>James</i>";
$own_name_enter[eng] = "Enter your name:";
$own_name_commit[eng] = "Set your name";
$own_name_remove[eng] = "If you dont want to use this option, leave it unchanged";
$stats_vhost_select[eng] = "Select server for viewing its statistics: ";
?>

View File

@ -1,330 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
// WARNING: File encoding is UTF-8 and should remain in this encoding!
if (__FILE__==$_SERVER['SCRIPT_FILENAME']) {
header("Location: index.php?act=logout");
exit;
}
$vhost_select[pol] = "Wybierz serwer";
$vhost_not_selected[pol] = "Nie wybrano żadnego serwera!";
$no_script[pol] = "Twoja przeglądarka ma wyłączoną obsługę JavaScript. Jorge wymaga aby obsługa Javascript-u była włączona!";
$act_su[pol] = "Zapisywanie rozmów na serwerze zostało włączone!";
$wrong_data[pol] = "Nieprawidłowa nazwa użytkownika lub hasło!";
$wrong_data2[pol] = "Nieprawidłowe słowo z obrazka, spróbuj jeszcze raz";
$act_su2[pol] = "Aby przeglądać archiwa musisz zalogować się ponownie do systemu";
$act_info[pol] = "Usługa archiwizowania rozmów nie została aktywowana dla użytkownika: ";
$warning1[pol] = "System wykrył że nie posiadasz jeszcze profilu, który wymagany jest do pracy. Aktywuj swój profil teraz.<br>
UWAGA: System jest w trakcie testów co oznacza że może nie działac w ogóle, działać wadliwie lub narazić Cię na utratę danych. Używasz go na własną odpowiedzialność!";
$welcome_1[pol] = "Jorge - archiwa rozmów. Zaloguj się do systemu";
$login_w[pol] = "Login";
$passwd_w[pol] = "Hasło";
$login_act[pol] = "Zaloguj się";
$devel_info[pol] = "Wersja BETA";
$activate_m[pol] = "AKTYWUJ";
$ch_lan[pol] = "Zmień język na:";
$ch_lan2[pol] = "Change language to ";
$lang_sw[pol] = "English";
$lang_sw2[pol] = "English";
$header_l[pol] = "Archiwa rozmów serwera";
$menu_item_browser[pol] = "Przeglądarka";
$menu_item_map[pol] = "Mapa Rozmów";
$menu_item_fav[pol] = "Ulubione";
$menu_item_search[pol] = "Wyszukiwarka";
$menu_item_links[pol] = "MyLinks";
$menu_item_panel[pol] = "Panel Sterowania";
$menu_item_contacts[pol] = "Kontakty";
$menu_item_logs[pol] = "Logi";
$menu_item_trash[pol] = "Kosz";
$filter_form[pol] = "Filtruj listę kontaktów<span style=\"vertical-align: super;\"><small> *</small></span>";
$filter_form_tip[pol] = "Wpisz nazwę kontaktu";
$filter_tip[pol] = "...a następnie wybierz z listy, lub przeszukaj listę ręcznie:";
$ff_notice[pol] = "Ta opcja działa tylko w przeglądarce Firefox";
$search_box[pol] = "Szukaj w archiwach";
$search_tip[pol] = "Wyświetlam";
$search_why[pol] = " wyników (<i>nie więcej niż 100</i>). <a href=\"help.php#22\" target=\"_blank\"><u>Dowiedz się dlaczego</u></a>";
$search_warn[pol] = "Uwaga: Wyszukuje tylko w wybranym przedziale czasu";
$all_for_u[pol] = "Pokaż wszystkie rozmowy używając: ";
$all_for_u_m[pol] = "strumienia";
$all_for_u_m_d[pol] = "Pokaż wszystkie rozmowy z tą osobą jako strumień wiadomości";
$all_for_u_m2[pol] = "mapy";
$all_for_u_m2_d[pol] = "Pokaż wszystkie rozmowy z tą osobą jako mapę rozmów";
$all_for_u_t[pol] = "Pokaż wszystkie rozmowy z tym użytkownikiem";
$arch_on[pol] = "Włącz archiwizacje";
$arch_off[pol] = "Wyłącz archiwizacje";
$log_out_b[pol] = "Wyloguj";
$archives_t[pol] = "Przeglądarka archiwum";
$main_date[pol] = "Data:";
$talks[pol] = "Lista rozmów:";
$thread[pol] = "Treść:";
$time_t[pol] = "Czas:";
$user_t[pol] = "Użytkownik:";
$my_links_save[pol] = "MyLinks";
$my_links_desc_m[pol] = "MyLinks - Twoje linki";
$my_links_desc_e[pol] = "Tutaj znajdziesz listę zapisanych fragmentów rozmów";
$settings_desc[pol] = "Ustawienia archiwum";
$settings_desc_detail[pol] = "Panel zawiera opcje pozwalające kontrolować archiwizacje rozmów oraz opcje dotyczące konta";
$api_access_enable[pol] = "Włącz publiczne API dla tego konta";
$api_access_disable[pol] = "Wyłącz publiczne API dla tego konta";
$api_access_on[pol] = "API dla tego konta jest włączone";
$api_access_learn[pol] = "Dowiedz się więcej na temat publicznego API";
$print_t[pol] = "drukuj";
$del_t[pol] = "usuń";
$resource_only[pol] = "Pokaż rozmowę tylko z tym zasobem";
$resource_warn[pol] = "Pokazuję rozmowę z zasobem: ";
$resource_discard[pol] = "Pokaż ";
$resource_discard2[pol] = "całą rozmowę.";
$del_all_conf[pol] = "Czy napewno chcesz usunąć *CAŁE* swoje archiwum wiadomości?\\nUWAGA: Nie będzie możliwości przywrócenia archiwum!";
$deleted_all[pol] = "Całe Twoje archiwum zostało usunięte";
$delete_nothing[pol] = "Twoje archiwum jest puste. Nic nie usunięto";
$delete_error[pol] = "Ooops...Wystąpiły błędy podczas wykonywania polecenia. Proszę spróbować poźniej";
$search_w1[pol] = "Wyszukiwany ciąg nie może być krótszy niż 3 i dłuższy niż 70 znaków...";
$search_res[pol] = "Wyniki wyszukiwania: ";
$my_links_save_d[pol] = "Zapisuje link. Wprowadź dane";
$my_links_optional[pol] = "Opis (opcjonalne, max 120 znakow)";
$my_links_chat[pol] = "Rozmowa z:";
$my_links_commit[pol] = "zapisz";
$my_links_cancel[pol] = "anuluj";
$my_links_link[pol] = "Link z dnia:";
$my_links_desc[pol] = "Opis:";
$my_links_added[pol] = "Link został zapisany!";
$my_links_back[pol] = "Wróć do rozmowy";
$my_links_removed[pol] = "Link został usunięty z bazy danych";
$my_links_none[pol] = "Brak opisu";
$status_msg1[pol] = "Archiwizacja rozmów jest aktualnie wyłączona";
$status_msg2[pol] = "Archiwizacja została włączona. (zmiany w profilu widoczne są po 10 sekundach)";
$status_msg3[pol] = "Archiwizacja została wyłączona. (zmiany w profilu widoczne są po 10 sekundach)";
$my_links_no_links[pol] = "Nie masz aktualnie zapisanych linków...";
$quest1[pol] = "Znalazłeś błąd? Zgłoś go!";
$search1[pol] = "Szukaj...";
$no_result[pol] = "Brak rezultatów wyszukiwania";
$settings_del[pol] = "Usuń całe archiwum";
$del_conf[pol] = "Czy na pewno usunąć tą rozmowę?";
$del_conf_my_link[pol] = "Czy na pewno usunąć ten link?";
$not_in_r[pol] = "Kontakt specjalny";
$del_moved[pol] = "Rozmowa została przeniesiona do kosza.";
$del_info[pol] = "Rozmowa została usunięta";
$undo_info[pol] = "Rozmowa została przywrócona";
$del_my_link[pol] = "usuń";
$help_but[pol] = "Pomoc";
$tip_delete[pol] = "Usuń historię rozmowy z tego dnia";
$tip_export[pol] = "Eksportuj rozmowę do pliku tekstowego";
$customize1[pol] = "Dostosuj logowanie";
$from_u[pol] = "Od: ";
$to_u[pol] = "Do: ";
$search_next[pol] = "Następne wyniki...";
$search_prev[pol] = "Poprzednie wyniki...";
$change_pass[pol] = "Zmień hasło";
$no_contacts[pol] = "Brak kontaktów na liście";
$no_archives[pol] = "W tej chwili nie masz zapisanych żadnych rozmów";
$con_tab1[pol] = "Lp.";
$con_tab2[pol] = "Nazwa kontaktu";
$con_tab3[pol] = "JabberID";
$con_tab4[pol] = "Włączyć archiwizacje";
$con_tab_act_y[pol] = "Tak";
$con_tab_act_n[pol] = "Nie";
$con_tab_submit[pol] = "Zapisz zmiany";
$con_tab6[pol] = "Grupa";
$con_no_g[pol] = "Brak grupy";
$map_no_g[pol] = "brak grupy";
$con_head[pol] = "Zarządzanie kontaktami";
$con_notice[pol] = "Uwaga: wyświetlane są tylko kontakty z przypisaną nazwą kontaktu.";
$con_title[pol] = "Kliknij na kontakcie aby zobaczyć archiwum rozmów";
$con_saved[pol] = "Zmiany zostały zapisane";
$help_notice[pol] = "Główne zagadnienia";
$nx_dy[pol] = "Kolejny dzień";
$no_more[pol] = "Brak większej ilości wyników";
$in_min[pol] = "minut";
$verb_h[pol] = "przerwa w rozmowie trwająca ponad godzinę";
$time_range_w[pol] = "Pole \"Od\" nie może być większe od pola \"Do\"";
$time_range_from[pol] = "od";
$time_range_to[pol] = "do";
$export_link[pol] = "eksportuj";
$export_head1[pol] = "Historia rozmowy między Tobą a ";
$export_head2[pol] = "przeprowadzona w dniu";
$help_search_tips[pol] = "
<br/><br/>
<li>Wyszukiwarka: Podpowiedzi.</li>
<ul>Przeszukując archiwa można zadawać kilka rodzajów zapytań na przykład:<br />
żeby znaleźć wszystkie rozmowy z danym użytkownikiem wpisujemy w oknie wyszukiwania:<br />
<b>from:jid@przykład.pl</b> - gdzie <i>jid</i> to nazwa użytkownika, a <i>przykład.pl</i> to serwer na którym wyszukiwana osoba ma konto.<br >
aby wyszukać daną frazę w rozmowie z użytkownikiem możemy wykonać następujące zapytanie:<br />
<b>from:jid@przykład.pl:co to jest jabber</b> - takie zapytanie przeszuka wszystkie rozmowy z użytkownikem <i>jid</i> z serwera <i>przykład.pl</i> w poszukiwaniu frazy: <i>co to jest jabber</i><br />
Wyszukiwarka obsługuje oczywiście zwykłe wyszukiwanie - we wszystkich przeprowadzonych przez nas rozmowach:<br />
<b>co to jest jabber</b> - wyszuka we wszystkich rozmowach frazy \"co to jest jabber\" jak również wyświetli wszystkie linie rozmowy zawierające słowa kluczowe<br />
Jeśli nie znamy pełnej nazwy której poszukijemy możemy daną/dane litery zastąpić znakiem: * (gwiazdka) np.:<br />
<b>jak*</b> - znajdzie wszystkie słowa zaczynające się na <i>jak</i> czyli np. <i>jaki, jaka</i>
</ul>
";
$help_my_links_note[pol] = "
<br/><br/>
<li>MyLinks: informacje ogólne.</li>
<ul>MyLinks służy do przechowywania(zapamiętywania) ulubionych fragmentów rozmów. Dzieki opcji MyLinks można w łatwy i szybki sposób odnaleźć poszukiwaną rozmowę.<br />
Aby dodać daną rozmowę do MyLinks należy kliknąć po prawej stronie okna z wyszukiwaną rozmową na opcji \"zapisz w mylinks\". Po wprowadzeniu opisu, link zostanie<br />
zapisany w zakładce MyLinks.
</ul>
";
$help_advanced_tips[pol] = "
<br/><br/>
<li>Jak szukać dokładnie?</li>
<ul>Wyszukiwarga <b>Jorge</b> obsługuje zaawansowane tryby wyszukiwania tzw. <i>Boolean mode</i>, co oznacza że znacznie można poprawić rezultaty wyszukiwania.<br/>
Wyszukiwarka przeszukuje wszystkie Twoje archiwa w poszukiwaniu danej frazy, następnie ocenia tzw. <i>\"score\"</i>, sortuje dane i wyświetla najlepiej pasujące 100 wyników<br/>
Aby ułatwić wyszukiwanie możesz użyć następujących modyfikatorów:<br>
<b>+</b> - oznacza że dane słowo musi znaleźć się w wynikach wyszukiwania np. (+abc +def - odszuka wszystkie rozmowy zawierające w danej lini abc oraz def)<br>
<b>-</b> - oznacza że dane słowo ma nie występować w wynikach wyszukiwania<br/>
<b>></b> oraz <b><</b> - nadaje dodatkowe punkty wyszukiwanemu słowu w frazie. Np. poszukując linka wiemy że zawieta http i np. słowo planeta. Aby zwiększyć trafność wyników zapytanie powinno wyglądać tak: \"http &lt;planeta\"</br>
<b>( )</b> - oznacza wykonanie pod-zapytania</br>
<b>~</b> - dodaje negatywne punkty do danego słowa - ale go nie wyklucza z wyników</br>
<b>*</b> - zastępuje ciąg znaków</br>
<b>\"</b> - oznacza wyszukiwanie dokładnie pasującej frazy np: \"jak to\" znajdzie tylko rozmowy z dokładnie tą frazą
</ul>
";
$admin_site_gen[pol] = "Strona została wygenerowana w: ";
$logger_from_day[pol] = " z dnia: ";
$logger_overview[pol] = "Logi aktywności w Jorge";
$logger_f1[pol] = "Zdarzenie:";
$logger_f2[pol] = "Data zdarzenia:";
$logger_f3[pol] = "Poziom zdarzenia:";
$logger_f4[pol] = "Dodatkowe informacje:";
$logger_f_ip[pol] = "z adresu IP: ";
$refresh[pol] = "Odśwież";
$back_t[pol] = "Wróć na góre strony";
$trash_name[pol] = "Kosz";
$trash_desc[pol] = "Lista rozmów usuniętych. Wiadomości które przebywają w koszu dłużej niż 30 dni są automatycznie usuwane";
$trash_undel[pol] = "Przywróć";
$trash_vit[pol] = "Zobacz przywróconą rozmowę";
$trash_del[pol] = "Usuń";
$trash_link[pol] = "Akcja";
$trash_empty[pol] = "Kosz jest pusty";
$trash_recovered[pol] = "Rozmowa została przeniesiona do archiwum";
$cal_head[pol] = "Kalendarz rozmów.";
$cal_notice[pol] = "Kliknij na danym dniu aby zobaczyć rozmowy";
$change_view[pol] = "Zmień na widok drzewa";
$change_view_cal[pol] = "Przeglądaj archiwum za pomocą widoku kalendarza.";
$months_names = array("Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień");
$weekdays = array("Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota","Niedziela");
$jump_to_l[pol] = "Wybierz miesiąc";
$chat_list_l[pol] = "Lista rozmów:";
$select_view[pol] = "Wybierz rodzaj widoku przeglądarki:";
$view_calendar[pol] = "Widok kalendarza";
$view_standard[pol] = "Widok drzewa";
$setting_d1[pol] = "Zmień globalną opcję archiwizacji:";
$setting_d2[pol] = "Usuń całe archiwum wiadomości (<i>nie można wycofać</i>):";
$chat_map[pol] = "Mapa rozmów";
$chat_select[pol] = "Wybierz kontakt aby zobaczyć listę rozmów";
$chat_m_select[pol] = "Wybierz kontakt:";
$chat_c_list[pol] = "Lista kontaktów";
$chat_no_chats[pol] = "Brak rozmów z wybranym kontaktem";
$chat_map_back[pol] = "<<< Wróć do Mapy Rozmów";
$fav_back[pol] = "<<< Wróć do Ulubionych";
$myl_back[pol] = "<<< Wróć do MyLinks";
$sel_language[pol] = "Wybierz preferowany język";
$sel_client[pol] = "Uruchom Slimster";
$sel_yes[pol] = "Tak";
$sel_no[pol] = "Nie";
$jump_to_next[pol] = "Przejdź do następnego dnia rozmowy";
$jump_to_prev[pol] = "Przejdź do poprzedniego dnia rozmowy";
$show_chats[pol] = "Pokaż rozmowę jako";
$show_chat_stream[pol] = "strumień";
$show_chat_as_map[pol] = "mapę";
$tip_next_m[pol] = "Przejdź do następnego miesiąca";
$tip_prev_m[pol] = "Przejdź do poprzedniego miesiąca";
$cal_days[pol]['1'] = "Pon";
$cal_days[pol]['2'] = "Wto";
$cal_days[pol]['3'] = "Śro";
$cal_days[pol]['4'] = "Czw";
$cal_days[pol]['5'] = "Pią";
$cal_days[pol]['6'] = "Sob";
$cal_days[pol]['7'] = "Nie";
$chat_lines[pol] = "Ilość wiadomości: ";
$del_time[pol] = "Usunięto:";
$marked_as_d[pol] = "Ta rozmowa znajduje się w koszu. Aby ją przeglądać musisz ją <a href=\"trash.php\"><u>przywrócić</u></a>";
$stats_personal_d[pol] = "Statystyki rozmów";
$stats_personal[pol] = "Twoja całkowita liczba wiadomości w archiwum:";
$stats_personal_top[pol] = "10 najdłuższych rozmów:";
$stats_when[pol] = "Kiedy";
$stats_personal_count[pol] = "Liczba wiadomości";
$stats_peer[pol] = "Rozmówca";
$stats_see[pol] = "Zobacz rozmowę";
$stats_for[pol] = "Statystyki dla: ";
$stats_messages[pol] = "Serwer zalogował ";
$stats_messages_b[pol] = " wiadomości w ";
$stats_messages_c[pol] = " rozmowach.";
$stats_graph1[pol] = "Całkowita liczba użytkowników korzystających z archiwizacji (dziennie)";
$stats_graph2[pol] = "Ilość wiadomości zalogowanych przez serwer (dziennie)";
$stats_graph3[pol] = "Zalogowane wiadomości (godzinowo)";
$stats_graph4[pol] = "Zalogowane wiadomości (tygodniowo)";
$stats_top[pol] = "Najdłuższe rozmowy z ostatnich dni:";
$stats_not_eno[pol] = "Brak wystarczających danych do narysowania statystyk (<i>minimum 30 dni</i>)";
$fav_main[pol] = "Ulubione";
$fav_desc[pol] = "Lista rozmów oznaczonych jako \"Ulubione\"";
$fav_add[pol] = "Dodaj rozmowę do ulubionych";
$fav_chat[pol] = "Rozmowa z: ";
$fav_success[pol] = "Rozmowa została dodana do Twoich <i>Ulubionych</i> !";
$fav_discard[pol] = "Ukryj tą informacje";
$fav_exist[pol] = "Ooops...Ta rozmowa juz znajduje się w Twoich <i>Ulubionych</i>";
$fav_favorited[pol] = "Ta rozmowa jest dodana do ulubionych";
$fav_contact[pol] = "Rozmowa z:";
$fav_when[pol] = "Kiedy:";
$fav_comment[pol] = "Komentarz:";
$fav_nocomm[pol] = "Brak komentarza";
$fav_add_comment[pol] = "Dodaj komentarz";
$fav_remove[pol] = "usuń";
$fav_removed[pol] = "Rozmowa została usnięta z <i>Ulubionych</i>";
$fav_empty[pol] = "Nie masz aktualnie zapisanych żadnych <i>Ulubionych</i> rozmów";
$fav_error[pol] = "Oooups...Wystąpił błąd podczas dodawania rozmowy";
$reset_sort[pol] = "resetuj sortowanie";
$cont_chat[pol] = "rozmowa kontynuowana jest następnego dnia >>>";
$cont_chat_p[pol] = "<<< rozmowa jest kontynuacją z dnia poprzedniego";
$close_account[pol] = "Usuń konto z serwera:";
$close_info[pol] = "UWAGA: wraz z kontem XMPP zostanie usunięte konto z Google Apps!";
$close_warn[pol] = "Czy napewno usunąć konto i wszystkie wiadomości?";
$close_commit[pol] = "- Usuń teraz -";
$close_failed[pol] = "Usunięcie konta nie powiodło się. Proszę spróbować później";
$oper_fail[pol] = "<center><b>Operacja nie została wykonana! Proszę spróbować później lub skontaktować się z administratorem!</b></center>";
$go_to_jorge[pol] = "Idz do strony glownej";
$qlink_l[pol] = "Przejdź do najnowszych rozmów";
$message_type_message[pol] = "Wiadomość";
$message_type_error[pol] = "Wiadomość została oznaczona jako zawierająca błąd i prawdopodobnie nie została dostarczona.";
$message_type_headline[pol] = "Headline";
$muc_message[pol] = "Wiadomość systemowa:";
$spec_contact_enable[pol] = "Wyświetlać kontakty specjalne:";
$spec_contact_desc[pol] = "Pozwala zdecydować czy w liście rozmów mają pojawiać się rozmowy z kontaktami specjalnymi np.: bramkami lub transportami. Większość użytkowników może spokojnie tą opcje wyłączyć";
$donate[pol] = "<small>Pomóż rozwijać Projekt Jorge.<a href=\"http://www.jabster.pl/index.php?q=node/43\" target=\"_blank\"><u>Przeczytaj więcej...</u></a></small>";
$donate_dont[pol] = "<small>Nie pokazuj tej informacji więcej...</small>";
$own_name_desc[pol] = "Opcja ta umożliwia zmianę wyświetlanej nazwy użytkownika: np. <i>karol002a</i> na <i>Karol</i>";
$own_name_enter[pol] = "Podaj swoją nazwę:";
$own_name_commit[pol] = "Ustaw nazwę";
$own_name_remove[pol] = "Jeśli nie chcesz korzystać z tej opcji, pozostaw pole puste";
$stats_vhost_select[pol] = "Wybierz serwer dla którego chcesz oglądać statystyki: ";
?>

View File

@ -1,320 +0,0 @@
/*
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* $LastChangedDate: 2007-03-27 23:29:43 +0200 (Di, 27 Mrz 2007) $
* $Rev: 1601 $
*/
jQuery.fn._height = jQuery.fn.height;
jQuery.fn._width = jQuery.fn.width;
/**
* If used on document, returns the document's height (innerHeight)
* If used on window, returns the viewport's (window) height
* See core docs on height() to see what happens when used on an element.
*
* @example $("#testdiv").height()
* @result 200
*
* @example $(document).height()
* @result 800
*
* @example $(window).height()
* @result 400
*
* @name height
* @type Object
* @cat Plugins/Dimensions
*/
jQuery.fn.height = function() {
if ( this[0] == window )
return self.innerHeight ||
jQuery.boxModel && document.documentElement.clientHeight ||
document.body.clientHeight;
if ( this[0] == document )
return Math.max( document.body.scrollHeight, document.body.offsetHeight );
return this._height(arguments[0]);
};
/**
* If used on document, returns the document's width (innerWidth)
* If used on window, returns the viewport's (window) width
* See core docs on height() to see what happens when used on an element.
*
* @example $("#testdiv").width()
* @result 200
*
* @example $(document).width()
* @result 800
*
* @example $(window).width()
* @result 400
*
* @name width
* @type Object
* @cat Plugins/Dimensions
*/
jQuery.fn.width = function() {
if ( this[0] == window )
return self.innerWidth ||
jQuery.boxModel && document.documentElement.clientWidth ||
document.body.clientWidth;
if ( this[0] == document )
return Math.max( document.body.scrollWidth, document.body.offsetWidth );
return this._width(arguments[0]);
};
/**
* Returns the inner height value (without border) for the first matched element.
* If used on document, returns the document's height (innerHeight)
* If used on window, returns the viewport's (window) height
*
* @example $("#testdiv").innerHeight()
* @result 800
*
* @name innerHeight
* @type Number
* @cat Plugins/Dimensions
*/
jQuery.fn.innerHeight = function() {
return this[0] == window || this[0] == document ?
this.height() :
this.css('display') != 'none' ?
this[0].offsetHeight - (parseInt(this.css("borderTopWidth")) || 0) - (parseInt(this.css("borderBottomWidth")) || 0) :
this.height() + (parseInt(this.css("paddingTop")) || 0) + (parseInt(this.css("paddingBottom")) || 0);
};
/**
* Returns the inner width value (without border) for the first matched element.
* If used on document, returns the document's Width (innerWidth)
* If used on window, returns the viewport's (window) width
*
* @example $("#testdiv").innerWidth()
* @result 1000
*
* @name innerWidth
* @type Number
* @cat Plugins/Dimensions
*/
jQuery.fn.innerWidth = function() {
return this[0] == window || this[0] == document ?
this.width() :
this.css('display') != 'none' ?
this[0].offsetWidth - (parseInt(this.css("borderLeftWidth")) || 0) - (parseInt(this.css("borderRightWidth")) || 0) :
this.height() + (parseInt(this.css("paddingLeft")) || 0) + (parseInt(this.css("paddingRight")) || 0);
};
/**
* Returns the outer height value (including border) for the first matched element.
* Cannot be used on document or window.
*
* @example $("#testdiv").outerHeight()
* @result 1000
*
* @name outerHeight
* @type Number
* @cat Plugins/Dimensions
*/
jQuery.fn.outerHeight = function() {
return this[0] == window || this[0] == document ?
this.height() :
this.css('display') != 'none' ?
this[0].offsetHeight :
this.height() + (parseInt(this.css("borderTopWidth")) || 0) + (parseInt(this.css("borderBottomWidth")) || 0)
+ (parseInt(this.css("paddingTop")) || 0) + (parseInt(this.css("paddingBottom")) || 0);
};
/**
* Returns the outer width value (including border) for the first matched element.
* Cannot be used on document or window.
*
* @example $("#testdiv").outerWidth()
* @result 1000
*
* @name outerWidth
* @type Number
* @cat Plugins/Dimensions
*/
jQuery.fn.outerWidth = function() {
return this[0] == window || this[0] == document ?
this.width() :
this.css('display') != 'none' ?
this[0].offsetWidth :
this.height() + (parseInt(this.css("borderLeftWidth")) || 0) + (parseInt(this.css("borderRightWidth")) || 0)
+ (parseInt(this.css("paddingLeft")) || 0) + (parseInt(this.css("paddingRight")) || 0);
};
/**
* Returns how many pixels the user has scrolled to the right (scrollLeft).
* Works on containers with overflow: auto and window/document.
*
* @example $("#testdiv").scrollLeft()
* @result 100
*
* @name scrollLeft
* @type Number
* @cat Plugins/Dimensions
*/
jQuery.fn.scrollLeft = function() {
if ( this[0] == window || this[0] == document )
return self.pageXOffset ||
jQuery.boxModel && document.documentElement.scrollLeft ||
document.body.scrollLeft;
return this[0].scrollLeft;
};
/**
* Returns how many pixels the user has scrolled to the bottom (scrollTop).
* Works on containers with overflow: auto and window/document.
*
* @example $("#testdiv").scrollTop()
* @result 100
*
* @name scrollTop
* @type Number
* @cat Plugins/Dimensions
*/
jQuery.fn.scrollTop = function() {
if ( this[0] == window || this[0] == document )
return self.pageYOffset ||
jQuery.boxModel && document.documentElement.scrollTop ||
document.body.scrollTop;
return this[0].scrollTop;
};
/**
* Returns the location of the element in pixels from the top left corner of the viewport.
*
* For accurate readings make sure to use pixel values for margins, borders and padding.
*
* @example $("#testdiv").offset()
* @result { top: 100, left: 100, scrollTop: 10, scrollLeft: 10 }
*
* @example $("#testdiv").offset({ scroll: false })
* @result { top: 90, left: 90 }
*
* @example var offset = {}
* $("#testdiv").offset({ scroll: false }, offset)
* @result offset = { top: 90, left: 90 }
*
* @name offset
* @param Object options A hash of options describing what should be included in the final calculations of the offset.
* The options include:
* margin: Should the margin of the element be included in the calculations? True by default.
* If set to false the margin of the element is subtracted from the total offset.
* border: Should the border of the element be included in the calculations? True by default.
* If set to false the border of the element is subtracted from the total offset.
* padding: Should the padding of the element be included in the calculations? False by default.
* If set to true the padding of the element is added to the total offset.
* scroll: Should the scroll offsets of the parent elements be included in the calculations?
* True by default. When true, it adds the total scroll offsets of all parents to the
* total offset and also adds two properties to the returned object, scrollTop and
* scrollLeft. If set to false the scroll offsets of parent elements are ignored.
* If scroll offsets are not needed, set to false to get a performance boost.
* @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the
* chain will not be broken and the result will be assigned to this object.
* @type Object
* @cat Plugins/Dimensions
* @author Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
*/
jQuery.fn.offset = function(options, returnObject) {
var x = 0, y = 0, elem = this[0], parent = this[0], absparent=false, relparent=false, op, sl = 0, st = 0, options = jQuery.extend({ margin: true, border: true, padding: false, scroll: true }, options || {});
do {
x += parent.offsetLeft || 0;
y += parent.offsetTop || 0;
// Mozilla and IE do not add the border
if (jQuery.browser.mozilla || jQuery.browser.msie) {
// get borders
var bt = parseInt(jQuery.css(parent, 'borderTopWidth')) || 0;
var bl = parseInt(jQuery.css(parent, 'borderLeftWidth')) || 0;
// add borders to offset
x += bl;
y += bt;
// Mozilla removes the border if the parent has overflow property other than visible
if (jQuery.browser.mozilla && parent != elem && jQuery.css(parent, 'overflow') != 'visible') {
x += bl;
y += bt;
}
// Mozilla does not include the border on body if an element isn't positioned absolute and is without an absolute parent
if (jQuery.css(parent, 'position') == 'absolute') absparent = true;
// IE does not include the border on the body if an element is position static and without an absolute or relative parent
if (jQuery.css(parent, 'position') == 'relative') relparent = true;
}
if (options.scroll) {
// Need to get scroll offsets in-between offsetParents
op = parent.offsetParent;
do {
sl += parent.scrollLeft || 0;
st += parent.scrollTop || 0;
parent = parent.parentNode;
// Mozilla removes the border if the parent has overflow property other than visible
if (jQuery.browser.mozilla && parent != elem && parent != op && jQuery.css(parent, 'overflow') != 'visible') {
x += parseInt(jQuery.css(parent, 'borderLeftWidth')) || 0;
y += parseInt(jQuery.css(parent, 'borderTopWidth')) || 0;
}
} while (op && parent != op);
} else
parent = parent.offsetParent;
if (parent && (parent.tagName.toLowerCase() == 'body' || parent.tagName.toLowerCase() == 'html')) {
// Safari and IE Standards Mode doesn't add the body margin for elments positioned with static or relative
if ((jQuery.browser.safari || (jQuery.browser.msie && jQuery.boxModel)) && jQuery.css(elem, 'position') != 'absolute') {
x += parseInt(jQuery.css(parent, 'marginLeft')) || 0;
y += parseInt(jQuery.css(parent, 'marginTop')) || 0;
}
// Mozilla does not include the border on body if an element isn't positioned absolute and is without an absolute parent
// IE does not include the border on the body if an element is positioned static and without an absolute or relative parent
if ( (jQuery.browser.mozilla && !absparent) ||
(jQuery.browser.msie && jQuery.css(elem, 'position') == 'static' && (!relparent || !absparent)) ) {
x += parseInt(jQuery.css(parent, 'borderLeftWidth')) || 0;
y += parseInt(jQuery.css(parent, 'borderTopWidth')) || 0;
}
break; // Exit the loop
}
} while (parent);
if ( !options.margin) {
x -= parseInt(jQuery.css(elem, 'marginLeft')) || 0;
y -= parseInt(jQuery.css(elem, 'marginTop')) || 0;
}
// Safari and Opera do not add the border for the element
if ( options.border && (jQuery.browser.safari || jQuery.browser.opera) ) {
x += parseInt(jQuery.css(elem, 'borderLeftWidth')) || 0;
y += parseInt(jQuery.css(elem, 'borderTopWidth')) || 0;
} else if ( !options.border && !(jQuery.browser.safari || jQuery.browser.opera) ) {
x -= parseInt(jQuery.css(elem, 'borderLeftWidth')) || 0;
y -= parseInt(jQuery.css(elem, 'borderTopWidth')) || 0;
}
if ( options.padding ) {
x += parseInt(jQuery.css(elem, 'paddingLeft')) || 0;
y += parseInt(jQuery.css(elem, 'paddingTop')) || 0;
}
// Opera thinks offset is scroll offset for display: inline elements
if (options.scroll && jQuery.browser.opera && jQuery.css(elem, 'display') == 'inline') {
sl -= elem.scrollLeft || 0;
st -= elem.scrollTop || 0;
}
var returnValue = options.scroll ? { top: y - st, left: x - sl, scrollTop: st, scrollLeft: sl }
: { top: y, left: x };
if (returnObject) { jQuery.extend(returnObject, returnValue); return this; }
else { return returnValue; }
};

View File

@ -1,179 +0,0 @@
/*
* This is the function that actually highlights a text string by
* adding HTML tags before and after all occurrences of the search
* term. You can pass your own tags if you'd like, or if the
* highlightStartTag or highlightEndTag parameters are omitted or
* are empty strings then the default <font> tags will be used.
*/
function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag)
{
// the highlightStartTag and highlightEndTag parameters are optional
if ((!highlightStartTag) || (!highlightEndTag)) {
highlightStartTag = "<font style='color:blue; background-color:yellow;'>";
highlightEndTag = "</font>";
}
// find all occurences of the search term in the given text,
// and add some "highlight" tags to them (we're not using a
// regular expression search, because we want to filter out
// matches that occur within HTML tags and script blocks, so
// we have to do a little extra validation)
var newText = "";
var i = -1;
var lcSearchTerm = searchTerm.toLowerCase();
var lcBodyText = bodyText.toLowerCase();
while (bodyText.length > 0) {
i = lcBodyText.indexOf(lcSearchTerm, i+1);
if (i < 0) {
newText += bodyText;
bodyText = "";
} else {
// skip anything inside an HTML tag
if (bodyText.lastIndexOf(">", i) >= bodyText.lastIndexOf("<", i)) {
// skip anything inside a <script> block
if (lcBodyText.lastIndexOf("/script>", i) >= lcBodyText.lastIndexOf("<script", i)) {
newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + highlightEndTag;
bodyText = bodyText.substr(i + searchTerm.length);
lcBodyText = bodyText.toLowerCase();
i = -1;
}
}
}
}
return newText;
}
/*
* This is sort of a wrapper function to the doHighlight function.
* It takes the searchText that you pass, optionally splits it into
* separate words, and transforms the text on the current web page.
* Only the "searchText" parameter is required; all other parameters
* are optional and can be omitted.
*/
function highlightSearchTerms(searchText, treatAsPhrase, warnOnFailure, highlightStartTag, highlightEndTag)
{
// if the treatAsPhrase parameter is true, then we should search for
// the entire phrase that was entered; otherwise, we will split the
// search string so that each word is searched for and highlighted
// individually
if (treatAsPhrase) {
searchArray = [searchText];
} else {
searchArray = searchText.split(" ");
}
if (!document.body || typeof(document.body.innerHTML) == "undefined") {
if (warnOnFailure) {
alert("Sorry, for some reason the text of this page is unavailable. Searching will not work.");
}
return false;
}
var bodyText = document.body.innerHTML;
for (var i = 0; i < searchArray.length; i++) {
bodyText = doHighlight(bodyText, searchArray[i], highlightStartTag, highlightEndTag);
}
document.body.innerHTML = bodyText;
return true;
}
/*
* This displays a dialog box that allows a user to enter their own
* search terms to highlight on the page, and then passes the search
* text or phrase to the highlightSearchTerms function. All parameters
* are optional.
*/
function searchPrompt(defaultText, treatAsPhrase, textColor, bgColor)
{
// This function prompts the user for any words that should
// be highlighted on this web page
if (!defaultText) {
defaultText = "";
}
// we can optionally use our own highlight tag values
if ((!textColor) || (!bgColor)) {
highlightStartTag = "";
highlightEndTag = "";
} else {
highlightStartTag = "<font style='color:" + textColor + "; background-color:" + bgColor + ";'>";
highlightEndTag = "</font>";
}
if (treatAsPhrase) {
promptText = "Please enter the phrase you'd like to search for:";
} else {
promptText = "Please enter the words you'd like to search for, separated by spaces:";
}
searchText = prompt(promptText, defaultText);
if (!searchText) {
alert("No search terms were entered. Exiting function.");
return false;
}
return highlightSearchTerms(searchText, treatAsPhrase, true, highlightStartTag, highlightEndTag);
}
/*
* This function takes a referer/referrer string and parses it
* to determine if it contains any search terms. If it does, the
* search terms are passed to the highlightSearchTerms function
* so they can be highlighted on the current page.
*/
function highlightGoogleSearchTerms(referrer)
{
// This function has only been very lightly tested against
// typical Google search URLs. If you wanted the Google search
// terms to be automatically highlighted on a page, you could
// call the function in the onload event of your <body> tag,
// like this:
// <body onload='highlightGoogleSearchTerms(document.referrer);'>
//var referrer = document.referrer;
if (!referrer) {
return false;
}
var queryPrefix = "q=";
var startPos = referrer.toLowerCase().indexOf(queryPrefix);
if ((startPos < 0) || (startPos + queryPrefix.length == referrer.length)) {
return false;
}
var endPos = referrer.indexOf("&", startPos);
if (endPos < 0) {
endPos = referrer.length;
}
var queryString = referrer.substring(startPos + queryPrefix.length, endPos);
// fix the space characters
queryString = queryString.replace(/%20/gi, " ");
queryString = queryString.replace(/\+/gi, " ");
// remove the quotes (if you're really creative, you could search for the
// terms within the quotes as phrases, and everything else as single terms)
queryString = queryString.replace(/%22/gi, "");
queryString = queryString.replace(/\"/gi, "");
return highlightSearchTerms(queryString, false);
}
/*
* This function is just an easy way to test the highlightGoogleSearchTerms
* function.
*/
function testHighlightGoogleSearchTerms()
{
var referrerString = "http://www.google.com/search?q=javascript%20highlight&start=0";
referrerString = prompt("Test the following referrer string:", referrerString);
return highlightGoogleSearchTerms(referrerString);
}

View File

@ -1,380 +0,0 @@
/*----------------------------------------------------------------------------\
| IE Canvas 1.0 |
|-----------------------------------------------------------------------------|
| Created by Emil A Eklund |
| (http://eae.net/contact/emil) |
|-----------------------------------------------------------------------------|
| Implementation of the canvas API for Internet Explorer. Uses VML. |
|-----------------------------------------------------------------------------|
| Copyright (c) 2005 Emil A Eklund |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| This program is free software; you can redistribute it and/or modify it |
| under the terms of the MIT License. |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| Permission is hereby granted, free of charge, to any person obtaining a |
| copy of this software and associated documentation files (the "Software"), |
| to deal in the Software without restriction, including without limitation |
| the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| and/or sell copies of the Software, and to permit persons to whom the |
| Software is furnished to do so, subject to the following conditions: |
| The above copyright notice and this permission notice shall be included in |
| all copies or substantial portions of the Software. |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| DEALINGS IN THE SOFTWARE. |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| http://eae.net/license/mit |
|-----------------------------------------------------------------------------|
| Dependencies: canvas.js - For initialization of canvas elements |
|-----------------------------------------------------------------------------|
| 2005-12-27 | Work started. |
| 2005-12-29 | First version posted. |
| 2006-01-03 | Fixed bug in moveTo and lineTo, arguments where not converted |
| | to int which could cause IE to enter an endless loop. Disabled |
| | antalias for fillRect to better comply with the Mozilla, Opera |
| | and possibly Safari implementations where using fillRect is |
| | about the only way to raw non antialiased lines. |
|-----------------------------------------------------------------------------|
| Created 2005-12-27 | All changes are in the log above. | Updated 2006-01-03 |
\----------------------------------------------------------------------------*/
<public:component>
<public:method name="getContext" />
<public:attach event="oncontentready" onevent="initCanvas()"/>
</public:component>
<script language="JScript">
function getContext() {
return element.context;
}
function initCanvas() {
element.context = new IECanvasContext();
element.style.position = 'relative';
element.style.display = 'block';
element.style.overflow = 'hidden';
}
function IECanvasContext() {
this.fillStyle = 'black';
this.globalAlpha = 1.0;
this.globalCompositeOperation = '';
this.lineCap = '';
this.lineJoin = '';
this.lineWidth = '0';
this.miterLimit = '';
this.shadowBlur = '';
this.shadowColor = '';
this.shadowOffsetX = '';
this.shadowOffsetY = '';
this.strokeStyle = 'black';
this._path = '';
this._stateStack = new Array();
this._offsetX = 0;
this._offsetY = 0;
this._rotation = 0;
};
IECanvasContext.prototype.save = function() {
var o;
o = new Object();
this._copyState(this, o);
this._stateStack.push(o);
};
IECanvasContext.prototype.restore = function() {
var o, n;
n = this._stateStack.length - 1;
if (n < 0) { return; }
o = this._stateStack[n];
this._copyState(o, this);
this._stateStack.splice(n, 1);
};
IECanvasContext.prototype._copyState = function(oFrom, oTo) {
oTo.fillStyle = oFrom.fillStyle;
oTo.lineCap = oFrom.lineCap;
oTo.lineJoin = oFrom.lineJoin;
oTo.lineWidth = oFrom.lineWidth;
oTo.miterLimit = oFrom.miterLimit;
oTo.shadowBlur = oFrom.shadowBlur;
oTo.shadowColor = oFrom.shadowColor;
oTo.shadowOffsetX = oFrom.shadowOffsetX;
oTo.shadowOffsetY = oFrom.shadowOffsetY;
oTo._offsetX = oFrom._offsetX;
oTo._offsetY = oFrom._offsetY;
oTo._rotation = oFrom._rotation;
};
IECanvasContext.prototype.rotate = function(r) {
var MAX = Math.PI * 2;
this._rotation += r;
while (this._rotation > MAX) { this._rotation = MAX - this._rotation; }
};
IECanvasContext.prototype.scale = function() { };
IECanvasContext.prototype.translate = function(x, y) {
this._offsetX += x;
this._offsetY += y;
};
IECanvasContext.prototype.bezierCurveTo = function(cp1x, cp1y, cp2x, cp2y, x, y) {
if (this._path) { this._path += ' '; }
this._path += 'qb' + cp1x + ',' + cp1y + ',' + cp2x + ',' + cp2y + ',' + x + ',' + y;
};
IECanvasContext.prototype.clip = function() { };
IECanvasContext.prototype.beginPath = function() {
this._path = '';
};
IECanvasContext.prototype.closePath = function() {
if (this._path) { this._path += ' '; }
this._path += 'x';
};
IECanvasContext.prototype.lineTo = function(x, y) {
if (this._path) { this._path += ' '; }
this._path += 'l' + parseInt(x) + ',' + parseInt(y);
};
IECanvasContext.prototype.moveTo = function(x, y) {
if (this._path) { this._path += ' '; }
this._path += 'm' + parseInt(x) + ',' + parseInt(y);
};
IECanvasContext.prototype.stroke = function() {
var o, s, cosa, sina, cx, cy, x, y;
if (!this._path) { return; }
this._path += ' e';
o = element.ownerDocument.createElement('v:shape');
o.fillColor = 'none';
o.filled = false;
o.strokeColor = this.strokeStyle;
o.stroked = true;
o.weight = this.lineWidth;
o.coordsize = element.offsetWidth + ',' + element.offsetHeight;
o.style.position = 'absolute';
o.style.left = this._offsetX;
o.style.top = this._offsetY;
o.style.width = element.offsetWidth;
o.style.height = element.offsetHeight;
o.path = this._path;
s = element.ownerDocument.createElement('v:stroke');
s.opacity = this.globalAlpha;
o.appendChild(s);
if (this._rotation) {
r = element.ownerDocument.createElement('v:group');
r.style.position = 'absolute';
r.style.left = 0;
r.style.top = 0;
r.style.width = element.offsetWidth;
r.style.height = element.offsetHeight;
r.coordsize = o.coordsize;
r.style.rotation = Math.round((this._rotation * 180) / Math.PI);
r.style.rotationCenter = '0,0';
r.appendChild(o);
element.appendChild(r);
cosa = Math.cos(this._rotation);
sina = Math.sin(this._rotation);
cx = element.offsetWidth / 2;
cy = element.offsetHeight / 2;
x = ( cx*(1-cosa) + cy*sina);
y = (-cx*sina + cy*(1-cosa));
r.style.left = x * -1;
r.style.top = y * -1;
}
else { element.appendChild(o); }
};
IECanvasContext.prototype.fill = function() {
var o, f, r;
if (!this._path) { return; }
this._path += ' e';
o = element.ownerDocument.createElement('v:shape');
o.fillColor = this.fillStyle;
o.strokeColor = this.strokeStyle;
o.stroked = false;
o.weight = this.lineWidth;
o.coordsize = element.offsetWidth + ',' + element.offsetHeight;
o.style.position = 'absolute';
o.style.left = this._offsetX;
o.style.top = this._offsetY;
o.style.width = element.offsetWidth;
o.style.height = element.offsetHeight;
o.path = this._path;
f = element.ownerDocument.createElement('v:fill');
f.opacity = this.globalAlpha;
o.appendChild(f);
if (this._rotation) {
r = element.ownerDocument.createElement('v:group');
r.style.position = 'absolute';
r.style.left = 0;
r.style.top = 0;
r.style.width = element.offsetWidth;
r.style.height = element.offsetHeight;
r.coordsize = o.coordsize;
r.style.rotation = Math.round((this._rotation * 180) / Math.PI);
r.style.rotationCenter = '0,0';
r.appendChild(o);
element.appendChild(r);
cosa = Math.cos(this._rotation);
sina = Math.sin(this._rotation);
cx = (element.offsetWidth) / 2;
cy = (element.offsetHeight) / 2;
x = ( cx*(1-cosa) + cy*sina);
y = (-cx*sina + cy*(1-cosa));
r.style.left = x * -1;
r.style.top = y * -1;
}
else { element.appendChild(o); }
};
IECanvasContext.prototype.arcTo = function(x1, y1, x2, y2, radius) {
// not implemented in gecko, not implemented here
};
IECanvasContext.prototype.quadraticCurveTo = function(cpx, cpy, x, y) {
if (this._path) { this._path += ' '; }
this._path += 'qb' + cpx + ',' + cpy + ',' + x + ',' + y;
};
IECanvasContext.prototype.arc = function(x, y, radius, startAngle, endAngle, clockwise) {
var xi, yi, x1, y1, x2, y2, x3, y3, x4, y4;
if (this._path) { this._path += ' '; }
xi = parseFloat(x);
yi = parseFloat(y);
x1 = xi - radius;
y1 = yi - radius;
x2 = xi + radius;
y2 = yi + radius;
x3 = xi + (Math.cos(startAngle) * radius);
y3 = yi + (Math.sin(startAngle) * radius);
x4 = xi + (Math.cos(endAngle) * radius);
y4 = yi + (Math.sin(endAngle) * radius);
x3 = Math.round(x3);
y3 = Math.round(y3);
x4 = Math.round(x4);
y4 = Math.round(y4);
this._path += 'ar' + x1 + ',' + y1 + ',' + x2 + ',' + y2 + ',' + x3 + ',' + y3 + ',' + x4 + ',' + y4;
};
IECanvasContext.prototype.rect = function(x, y, w, h) {
var x1, y1, x2, y2;
x2 = x + w;
y2 = y + h;
x1 = Math.round(x);
y1 = Math.round(y);
x2 = Math.round(x2);
y2 = Math.round(y2);
this._path += 'm' + x1 + ',' + y1;
this._path += ' l' + x2 + ',' + y1;
this._path += ' l' + x2 + ',' + y2;
this._path += ' l' + x1 + ',' + y2;
this._path += ' x'
};
IECanvasContext.prototype.strokeRect = function(x, y, w, h) {
var o, s;
o = element.ownerDocument.createElement('v:rect');
o.fillColor = 'none';
o.filled = false;
o.strokeColor = this.strokeStyle;
o.stroked = true;
o.weight = this.lineWidth;
o.style.position = 'absolute';
o.style.left = this._offsetX + x;
o.style.top = this._offsetY + y;
o.style.width = w;
o.style.height = h;
s = element.ownerDocument.createElement('v:fill');
s.opacity = this.globalAlpha;
o.appendChild(s);
element.appendChild(o);
};
IECanvasContext.prototype.clearRect = function(x, y, w, h) { };
IECanvasContext.prototype.fillRect = function(x, y, w, h) {
var o, f;
if ((x == 0) && (y == 0) && (w == element.offsetWidth) && (h == element.offsetHeight) && (this._offsetX == 0) && (this._offsetY == 0) && (this.globalAlpha == 1)) {
while (element.firstChild) { element.removeChild(element.lastChild); }
}
o = element.ownerDocument.createElement('v:rect');
o.fillColor = this.fillStyle;
o.filled = true;
o.stroked = false;
o.weight = 0;
o.style.position = 'absolute';
o.style.left = this._offsetX + x;
o.style.top = this._offsetY + y;
o.style.width = w;
o.style.height = h;
o.style.antialias = 'false';
f = element.ownerDocument.createElement('v:fill');
f.opacity = this.globalAlpha;
o.appendChild(f);
element.appendChild(o);
};
IECanvasContext.prototype.addColorStop = function() { };
IECanvasContext.prototype.createLinearGradient = function() { };
IECanvasContext.prototype.createPattern = function() { };
IECanvasContext.prototype.createRadialGradient = function() { };
IECanvasContext.prototype.drawImage = function() { };
IECanvasContext.prototype.drawImageFromRect = function() { };
</script>

File diff suppressed because one or more lines are too long

View File

@ -1,10 +0,0 @@
/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* $LastChangedDate: 2007-07-22 01:45:56 +0200 (Son, 22 Jul 2007) $
* $Rev: 2447 $
*
* Version 2.1.1
*/
(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};})(jQuery);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,317 +0,0 @@
;(function( $ ){
$.fn.quicksearch = function(options) {
options = jQuery.extend({
position: 'prepend',
attached: 'body',
formId: 'quicksearch',
labelText: 'Quick Search',
labelClass: 'qs_label',
inputText: null,
inputClass: 'qs_input',
loaderId: 'loader',
loaderClass: 'loader',
loaderImg: null,
loaderText: 'Loading...',
stripeRowClass: null,
hideElement: null,
delay: 500,
focusOnLoad: false,
onBefore: null,
onAfter: null,
filter: null,
randomElement: 'qs'+Math.floor(Math.random()*1000000)
}, options);
var timeout;
var cache;
var score = {};
var el = this;
var stripeRowLength = (!is_empty(options.stripeRowClass)) ? options.stripeRowClass.length : 0;
var doStripe = (stripeRowLength > 0) ? true : false;
function is_empty (i)
{
return (i == null || i == undefined || i == false) ? true: false;
}
function get_cache (el)
{
cache = $(el).not('.'+options.noResultsClass).map(function(){
return strip_html(normalise(this.innerHTML));
});
}
function normalise (i)
{
return $.trim(i.toLowerCase().replace(/\n/, '').replace(/\s{2,}/, ' '));
}
function get_key()
{
var input = strip_html(normalise($('input[rel="' + options.randomElement + '"]').val()));
if (typeof options.filter == "function") { input = options.filter(input); }
if (input.indexOf(' ') == -1)
{
return input;
}
else
{
return input.split(" ");
}
}
function test_key(k, value, type)
{
if (type == "string")
{
return test_key_string(k, value);
}
else
{
return test_key_arr(k, value);
}
}
function test_key_string(k, value)
{
return (value.indexOf(k) > -1);
}
function test_key_arr(k, value)
{
for (var i = 0; i < k.length; i++) {
var test = value.indexOf(k[i]);
if (test == -1) {
return false;
}
}
return true;
}
function strip_html (input)
{
var regexp = new RegExp(/\<[^\<]+\>/g);
var output = input.replace(regexp, "");
output = output.toLowerCase();
return output;
}
function select_element (el)
{
if(options.hideElement == "grandparent")
{
return $(el).parent().parent();
}
else if (options.hideElement == "parent")
{
return $(el).parent();
}
else
{
return $(el);
}
}
function stripe (el)
{
if (doStripe)
{
var i = 0;
select_element(el).filter(':visible').each(function () {
for (var j = 0; j < stripeRowLength; j++)
{
if (i == j)
{
$(this).addClass(options.stripeRowClass[i]);
}
else
{
$(this).removeClass(options.stripeRowClass[j]);
}
}
i = (i+1) % stripeRowLength;
});
}
}
function loader (o) {
if(options.loaderId)
{
var l = $('input[@rel="'+options.randomElement+'"]').parent().find('.loader');
if(o == 'hide')
{
l.hide();
}
else
{
l.show();
}
}
}
function place_form () {
var formPosition = options.position;
var formAttached = options.attached;
if(formPosition == 'before') {
$(formAttached).before( make_form() );
} else if(formPosition == 'prepend') {
$(formAttached).prepend( make_form() );
} else if(formPosition == 'append') {
$(formAttached).append( make_form() );
} else {
$(formAttached).after( make_form() );
}
}
function make_form ()
{
return '<form action="#" ' + 'id="'+ options.formId + '" ' + 'class="quicksearch">' +
make_form_label() + make_form_input() + make_form_loader() +
'</form>';
}
function make_form_label ()
{
if(!is_empty(options.labelText)) {
return '<label for="' + options.randomElement + '" '+
'class="' + options.labelClass + '">'
+ options.labelText
+ '</label> ';
}
return '';
}
function make_form_input ()
{
var val = (!is_empty(options.inputText)) ? options.inputText : ""
return '<input type="text" value="' + val + '" rel="' + options.randomElement + '" class="' + options.inputClass + '" id="'+options.randomElement+'" /> ';
}
function make_form_loader ()
{
if(!is_empty(options.loaderImg)) {
return '<img src="' + options.loaderImg + '" alt="Loading" id="' + options.loaderId + '" class="' + options.loaderClass + '" />';
} else {
return '<span id="' + options.loaderId + '" class="' + options.loaderClass + '">' + options.loaderText + '</span>';
}
}
function focus_on_load ()
{
$('input[rel="' + options.randomElement + '"]').get(0).focus();
}
function toggle_text () {
$('input[rel="' + options.randomElement + '"]').focus(function () {
if($(this).val() == options.inputText) {
$(this).val('');
}
}),
$('input[rel="' + options.randomElement + '"]').blur(function () {
if($(this).val() == "") {
$(this).val(options.inputText);
}
})
};
function init ()
{
place_form();
if(options.focusOnLoad) {
focus_on_load();
}
if(options.inputText != "" && options.inputText != null) {
toggle_text();
}
get_cache(el);
stripe(el);
loader('hide');
}
function qs ()
{
clearTimeout(timeout);
timeout = setTimeout(function () {
if (typeof options.onBefore == "function") { options.onBefore(); }
loader('show');
setTimeout(function () {
var k = get_key();
var k_type = (typeof k);
var i = 0;
if (k != "")
{
if (typeof score[k] == "undefined")
{
score[k] = new Array();
cache.each(function (i) {
if (test_key(k, cache[i], k_type))
{
score[k][i] = true;
}
});
}
if (score[k].length == 0)
{
select_element(el).hide();
}
else
{
$(el).not('.'+options.noResultsClass).each(function (i) {
if (score[k][i])
{
select_element(this).show();
}
else
{
select_element(this).hide();
}
});
}
}
else
{
select_element(el).show();
}
stripe(el);
}, options.delay/2);
setTimeout( function () {
loader('hide');
if (typeof options.onAfter == "function") { options.onAfter(); }
}, options.delay/2);
}, options.delay/2);
}
init();
$('input[rel="' + options.randomElement + '"]').keydown(function (e) {
var keycode = e.keyCode;
if (!(keycode == 9 || keycode == 13 || keycode == 16 || keycode == 17 || keycode == 18 || keycode == 38 || keycode == 40 || keycode == 224))
{
qs();
}
});
$('form.quicksearch').submit( function () { return false; });
return this;
}
})( jQuery );

View File

@ -1,310 +0,0 @@
/*
* Tooltip - jQuery plugin for styled tooltips
*
* Copyright (c) 2006 Jörn Zaefferer, Stefan Petre
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
/**
* Display a customized tooltip instead of the default one
* for every selected element. The tooltip behaviour mimics
* the default one, but lets you style the tooltip and
* specify the delay before displaying it.
*
* In addition, it displays the href value, if it is available.
*
* To style the tooltip, use these selectors in your stylesheet:
*
* #tooltip - The tooltip container
*
* #tooltip h3 - The tooltip title
*
* #tooltip p.body - The tooltip body, shown when using showBody
*
* #tooltip p.url - The tooltip url, shown when using showURL
*
* @example $('a, input, img').Tooltip();
* @desc Shows tooltips for anchors, inputs and images, if they have a title
*
* @example $('label').Tooltip({
* delay: 0,
* track: true,
* event: "click"
* });
* @desc Shows tooltips for labels with no delay, tracking mousemovement, displaying the tooltip when the label is clicked.
*
* @example // modify global settings
* $.extend($.fn.Tooltip.defaults, {
* track: true,
* delay: 0,
* showURL: false,
* showBody: " - ",
* fixPNG: true
* });
* // setup fancy tooltips
* $('a.pretty').Tooltip({
* extraClass: "fancy"
* });
$('img.pretty').Tooltip({
* extraClass: "fancy-img",
* });
* @desc This example starts with modifying the global settings, applying them to all following Tooltips; Afterwards, Tooltips for anchors with class pretty are created with an extra class for the Tooltip: "fancy" for anchors, "fancy-img" for images
*
* @param Object settings (optional) Customize your Tooltips
* @option Number delay The number of milliseconds before a tooltip is display, default is 250
* @option String event The event on which the tooltip is displayed, default is "mouseover", "click" works fine, too
* @option Boolean track If true, let the tooltip track the mousemovement, default is false
* @option Boolean showURL If true, shows the href or src attribute within p.url, default is true
* @option String showBody If specified, uses the String to split the title, displaying the first part in the h3 tag, all following in the p.body tag, separated with <br/>s, default is null
* @option String extraClass If specified, adds the class to the tooltip helper, default is null
* @option Boolean fixPNG If true, fixes transparent PNGs in IE, default is false
*
* @name Tooltip
* @type jQuery
* @cat Plugins/Tooltip
* @author Jörn Zaefferer (http://bassistance.de)
*/
(function($) {
// the tooltip element
var helper,
// it's title part
tTitle,
// it's body part
tBody,
// it's url part
tUrl,
// the current tooltipped element
current,
// the title of the current element, used for restoring
oldTitle,
// timeout id for delayed tooltips
tID;
// the public plugin method
$.fn.Tooltip = function(settings) {
// setup configuration
// TODO: allow multiple arguments to extend, see bug #344
settings = $.extend($.extend({}, arguments.callee.defaults), settings || {});
// there can be only one tooltip helper
if( !helper ) {
// create the helper, h3 for title, div for url
helper = $('<div id="tooltip"><h3></h3><p class="body"></p><p class="url"></p></div>')
// hide it at first
.hide()
// move to top and position absolute, to let it follow the mouse
.css({ position: 'absolute', zIndex: 3000 })
// add to document
.appendTo('body');
// save references to title and url elements
tTitle = $('h3', helper);
tBody = $('p:eq(0)', helper);
tUrl = $('p:eq(1)', helper);
}
// bind events for every selected element with a title attribute
$(this).filter('[@title]')
// save settings into each element
// TODO: pass settings via event system, not yet possible
.each(function() {
this.tSettings = settings;
})
// bind events
.bind("mouseover", save)
.bind(settings.event, handle);
return this;
};
// main event handler to start showing tooltips
function handle(event) {
// show helper, either with timeout or on instant
if( this.tSettings.delay )
tID = setTimeout(show, this.tSettings.delay);
else
show();
// if selected, update the helper position when the mouse moves
if(this.tSettings.track)
$('body').bind('mousemove', update);
// update at least once
update(event);
// hide the helper when the mouse moves out of the element
$(this).bind('mouseout', hide);
}
// save elements title before the tooltip is displayed
function save() {
// if this is the current source, or it has no title (occurs with click event), stop
if(this == current || !this.title)
return;
// save current
current = this;
var source = $(this),
settings = this.tSettings;
// save title, remove from element and set to helper
oldTitle = title = source.attr('title');
source.attr('title','');
if(settings.showBody) {
var parts = title.split(settings.showBody);
tTitle.html(parts.shift());
tBody.empty();
for(var i = 0, part; part = parts[i]; i++) {
if(i > 0)
tBody.append("<br/>");
tBody.append(part);
}
if(tBody.html())
tBody.show();
else
tBody.hide();
} else {
tTitle.html(title);
tBody.hide();
}
// if element has href or src, add and show it, otherwise hide it
href = (source.attr('href') || source.attr('src'));
if( settings.showURL && href )
tUrl.html(href.replace('http://', '')).show();
else
tUrl.hide();
// add an optional class for this tip
if( settings.extraClass ) {
helper.addClass(settings.extraClass);
}
// fix PNG background for IE
if (settings.fixPNG && $.browser.msie ) {
helper.each(function () {
if (this.currentStyle.backgroundImage != 'none') {
var image = this.currentStyle.backgroundImage;
image = image.substring(5, image.length - 2);
$(this).css({
'backgroundImage': 'none',
'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
});
}
});
}
}
// delete timeout and show helper
function show() {
tID = null;
helper.show();
update();
}
/**
* callback for mousemove
* updates the helper position
* removes itself when no current element
*/
function update(event) {
// if no current element is available, remove this listener
if( current == null ) {
$('body').unbind('mousemove', update);
return;
}
var left = helper[0].offsetLeft;
var top = helper[0].offsetTop;
if(event) {
// get the current mouse position
function pos(c) {
var p = c == 'X' ? 'Left' : 'Top';
return event['page' + c] || (event['client' + c] + (document.documentElement['scroll' + p] || document.body['scroll' + p])) || 0;
}
// position the helper 15 pixel to bottom right, starting from mouse position
left = pos('X') + 15;
top = pos('Y') + 15;
helper.css({
left: left + 'px',
top: top + 'px'
});
}
var v = viewport(),
h = helper[0];
// check horizontal position
if(v.x + v.cx < h.offsetLeft + h.offsetWidth) {
left -= h.offsetWidth + 20;
helper.css({left: left + 'px'});
}
// check vertical position
if(v.y + v.cy < h.offsetTop + h.offsetHeight) {
top -= h.offsetHeight + 20;
helper.css({top: top + 'px'});
}
}
function viewport() {
var e = document.documentElement || {},
b = document.body || {},
w = window;
return {
x: w.pageXOffset || e.scrollLeft || b.scrollLeft || 0,
y: w.pageYOffset || e.scrollTop || b.scrollTop || 0,
cx: min( e.clientWidth, b.clientWidth, w.innerWidth ),
cy: min( e.clientHeight, b.clientHeight, w.innerHeight )
};
function min() {
var v = Infinity;
for( var i = 0; i < arguments.length; i++ ) {
var n = arguments[i];
if( n && n < v ) v = n;
}
return v;
}
}
// hide helper and restore added classes and the title
function hide() {
// clear timeout if possible
if(tID)
clearTimeout(tID);
// no more current element
current = null;
helper.hide();
// remove optional class
if( this.tSettings.extraClass ) {
helper.removeClass( this.tSettings.extraClass);
}
// restore title and remove this listener
$(this)
.attr('title', oldTitle)
.unbind('mouseout', hide);
// remove PNG background fix for IE
if( this.tSettings.fixPNG && $.browser.msie ) {
helper.each(function () {
$(this).css({'filter': '', backgroundImage: ''});
});
}
}
// define global defaults, editable by client
$.fn.Tooltip.defaults = {
delay: 250,
event: "mouseover",
track: false,
showURL: true,
showBody: null,
extraClass: null,
fixPNG: false
};
})(jQuery);

View File

@ -1,277 +0,0 @@
<?php
/*
* This is a PHP library that handles calling reCAPTCHA.
* - Documentation and latest version
* http://recaptcha.net/plugins/php/
* - Get a reCAPTCHA API Key
* http://recaptcha.net/api/getkey
* - Discussion group
* http://groups.google.com/group/recaptcha
*
* Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net
* AUTHORS:
* Mike Crawford
* Ben Maurer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* The reCAPTCHA server URL's
*/
define("RECAPTCHA_API_SERVER", "http://api.recaptcha.net");
define("RECAPTCHA_API_SECURE_SERVER", "https://api-secure.recaptcha.net");
define("RECAPTCHA_VERIFY_SERVER", "api-verify.recaptcha.net");
/**
* Encodes the given data into a query string format
* @param $data - array of string elements to be encoded
* @return string - encoded request
*/
function _recaptcha_qsencode ($data) {
$req = "";
foreach ( $data as $key => $value )
$req .= $key . '=' . urlencode( stripslashes($value) ) . '&';
// Cut the last '&'
$req=substr($req,0,strlen($req)-1);
return $req;
}
/**
* Submits an HTTP POST to a reCAPTCHA server
* @param string $host
* @param string $path
* @param array $data
* @param int port
* @return array response
*/
function _recaptcha_http_post($host, $path, $data, $port = 80) {
$req = _recaptcha_qsencode ($data);
$http_request = "POST $path HTTP/1.0\r\n";
$http_request .= "Host: $host\r\n";
$http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
$http_request .= "Content-Length: " . strlen($req) . "\r\n";
$http_request .= "User-Agent: reCAPTCHA/PHP\r\n";
$http_request .= "\r\n";
$http_request .= $req;
$response = '';
if( false == ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) {
die ('Could not open socket');
}
fwrite($fs, $http_request);
while ( !feof($fs) )
$response .= fgets($fs, 1160); // One TCP-IP packet
fclose($fs);
$response = explode("\r\n\r\n", $response, 2);
return $response;
}
/**
* Gets the challenge HTML (javascript and non-javascript version).
* This is called from the browser, and the resulting reCAPTCHA HTML widget
* is embedded within the HTML form it was called from.
* @param string $pubkey A public key for reCAPTCHA
* @param string $error The error given by reCAPTCHA (optional, default is null)
* @param boolean $use_ssl Should the request be made over ssl? (optional, default is false)
* @return string - The HTML to be embedded in the user's form.
*/
function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false)
{
if ($pubkey == null || $pubkey == '') {
die ("To use reCAPTCHA you must get an API key from <a href='http://recaptcha.net/api/getkey'>http://recaptcha.net/api/getkey</a>");
}
if ($use_ssl) {
$server = RECAPTCHA_API_SECURE_SERVER;
} else {
$server = RECAPTCHA_API_SERVER;
}
$errorpart = "";
if ($error) {
$errorpart = "&amp;error=" . $error;
}
return '<script type="text/javascript" src="'. $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
<noscript>
<iframe src="'. $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge">
</noscript>';
}
/**
* A ReCaptchaResponse is returned from recaptcha_check_answer()
*/
class ReCaptchaResponse {
var $is_valid;
var $error;
}
/**
* Calls an HTTP POST function to verify if the user's guess was correct
* @param string $privkey
* @param string $remoteip
* @param string $challenge
* @param string $response
* @param array $extra_params an array of extra variables to post to the server
* @return ReCaptchaResponse
*/
function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $extra_params = array())
{
if ($privkey == null || $privkey == '') {
die ("To use reCAPTCHA you must get an API key from <a href='http://recaptcha.net/api/getkey'>http://recaptcha.net/api/getkey</a>");
}
if ($remoteip == null || $remoteip == '') {
die ("For security reasons, you must pass the remote ip to reCAPTCHA");
}
//discard spam submissions
if ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) {
$recaptcha_response = new ReCaptchaResponse();
$recaptcha_response->is_valid = false;
$recaptcha_response->error = 'incorrect-captcha-sol';
return $recaptcha_response;
}
$response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/verify",
array (
'privatekey' => $privkey,
'remoteip' => $remoteip,
'challenge' => $challenge,
'response' => $response
) + $extra_params
);
$answers = explode ("\n", $response [1]);
$recaptcha_response = new ReCaptchaResponse();
if (trim ($answers [0]) == 'true') {
$recaptcha_response->is_valid = true;
}
else {
$recaptcha_response->is_valid = false;
$recaptcha_response->error = $answers [1];
}
return $recaptcha_response;
}
/**
* gets a URL where the user can sign up for reCAPTCHA. If your application
* has a configuration page where you enter a key, you should provide a link
* using this function.
* @param string $domain The domain where the page is hosted
* @param string $appname The name of your application
*/
function recaptcha_get_signup_url ($domain = null, $appname = null) {
return "http://recaptcha.net/api/getkey?" . _recaptcha_qsencode (array ('domain' => $domain, 'app' => $appname));
}
function _recaptcha_aes_pad($val) {
$block_size = 16;
$numpad = $block_size - (strlen ($val) % $block_size);
return str_pad($val, strlen ($val) + $numpad, chr($numpad));
}
/* Mailhide related code */
function _recaptcha_aes_encrypt($val,$ky) {
if (! function_exists ("mcrypt_encrypt")) {
die ("To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.");
}
$mode=MCRYPT_MODE_CBC;
$enc=MCRYPT_RIJNDAEL_128;
$val=_recaptcha_aes_pad($val);
return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
}
function _recaptcha_mailhide_urlbase64 ($x) {
return strtr(base64_encode ($x), '+/', '-_');
}
/* gets the reCAPTCHA Mailhide url for a given email, public key and private key */
function recaptcha_mailhide_url($pubkey, $privkey, $email) {
if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) {
die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " .
"you can do so at <a href='http://mailhide.recaptcha.net/apikey'>http://mailhide.recaptcha.net/apikey</a>");
}
$ky = pack('H*', $privkey);
$cryptmail = _recaptcha_aes_encrypt ($email, $ky);
return "http://mailhide.recaptcha.net/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail);
}
/**
* gets the parts of the email to expose to the user.
* eg, given johndoe@example,com return ["john", "example.com"].
* the email is then displayed as john...@example.com
*/
function _recaptcha_mailhide_email_parts ($email) {
$arr = preg_split("/@/", $email );
if (strlen ($arr[0]) <= 4) {
$arr[0] = substr ($arr[0], 0, 1);
} else if (strlen ($arr[0]) <= 6) {
$arr[0] = substr ($arr[0], 0, 3);
} else {
$arr[0] = substr ($arr[0], 0, 4);
}
return $arr;
}
/**
* Gets html to display an email address given a public an private key.
* to get a key, go to:
*
* http://mailhide.recaptcha.net/apikey
*/
function recaptcha_mailhide_html($pubkey, $privkey, $email) {
$emailparts = _recaptcha_mailhide_email_parts ($email);
$url = recaptcha_mailhide_url ($pubkey, $privkey, $email);
return htmlentities($emailparts[0]) . "<a href='" . htmlentities ($url) .
"' onclick=\"window.open('" . htmlentities ($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities ($emailparts [1]);
}
?>

View File

@ -1,133 +0,0 @@
var persisteduls=new Object()
var ddtreemenu=new Object()
ddtreemenu.closefolder="img/closed.png" //set image path to "closed" folder image
ddtreemenu.openfolder="img/open.png" //set image path to "open" folder image
//////////No need to edit beyond here///////////////////////////
ddtreemenu.createTree=function(treeid, enablepersist, persistdays){
var ultags=document.getElementById(treeid).getElementsByTagName("ul")
if (typeof persisteduls[treeid]=="undefined")
persisteduls[treeid]=(enablepersist==true && ddtreemenu.getCookie(treeid)!="")? ddtreemenu.getCookie(treeid).split(",") : ""
for (var i=0; i<ultags.length; i++)
ddtreemenu.buildSubTree(treeid, ultags[i], i)
if (enablepersist==true){ //if enable persist feature
var durationdays=(typeof persistdays=="undefined")? 1 : parseInt(persistdays)
ddtreemenu.dotask(window, function(){ddtreemenu.rememberstate(treeid, durationdays)}, "unload") //save opened UL indexes on body unload
}
}
ddtreemenu.buildSubTree=function(treeid, ulelement, index){
ulelement.parentNode.className="submenu"
if (typeof persisteduls[treeid]=="object"){ //if cookie exists (persisteduls[treeid] is an array versus "" string)
if (ddtreemenu.searcharray(persisteduls[treeid], index)){
ulelement.setAttribute("rel", "open")
ulelement.style.display="block"
ulelement.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
}
else
ulelement.setAttribute("rel", "closed")
} //end cookie persist code
else if (ulelement.getAttribute("rel")==null || ulelement.getAttribute("rel")==false) //if no cookie and UL has NO rel attribute explicted added by user
ulelement.setAttribute("rel", "closed")
else if (ulelement.getAttribute("rel")=="open") //else if no cookie and this UL has an explicit rel value of "open"
ddtreemenu.expandSubTree(treeid, ulelement) //expand this UL plus all parent ULs (so the most inner UL is revealed!)
ulelement.parentNode.onclick=function(e){
var submenu=this.getElementsByTagName("ul")[0]
if (submenu.getAttribute("rel")=="closed"){
submenu.style.display="block"
submenu.setAttribute("rel", "open")
ulelement.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
}
else if (submenu.getAttribute("rel")=="open"){
submenu.style.display="none"
submenu.setAttribute("rel", "closed")
ulelement.parentNode.style.backgroundImage="url("+ddtreemenu.closefolder+")"
}
ddtreemenu.preventpropagate(e)
}
ulelement.onclick=function(e){
ddtreemenu.preventpropagate(e)
}
}
ddtreemenu.expandSubTree=function(treeid, ulelement){ //expand a UL element and any of its parent ULs
var rootnode=document.getElementById(treeid)
var currentnode=ulelement
currentnode.style.display="block"
currentnode.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
while (currentnode!=rootnode){
if (currentnode.tagName=="UL"){ //if parent node is a UL, expand it too
currentnode.style.display="block"
currentnode.setAttribute("rel", "open") //indicate it's open
currentnode.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
}
currentnode=currentnode.parentNode
}
}
ddtreemenu.flatten=function(treeid, action){ //expand or contract all UL elements
var ultags=document.getElementById(treeid).getElementsByTagName("ul")
for (var i=0; i<ultags.length; i++){
ultags[i].style.display=(action=="expand")? "block" : "none"
var relvalue=(action=="expand")? "open" : "closed"
ultags[i].setAttribute("rel", relvalue)
ultags[i].parentNode.style.backgroundImage=(action=="expand")? "url("+ddtreemenu.openfolder+")" : "url("+ddtreemenu.closefolder+")"
}
}
ddtreemenu.rememberstate=function(treeid, durationdays){ //store index of opened ULs relative to other ULs in Tree into cookie
var ultags=document.getElementById(treeid).getElementsByTagName("ul")
var openuls=new Array()
for (var i=0; i<ultags.length; i++){
if (ultags[i].getAttribute("rel")=="open")
openuls[openuls.length]=i //save the index of the opened UL (relative to the entire list of ULs) as an array element
}
if (openuls.length==0) //if there are no opened ULs to save/persist
openuls[0]="none open" //set array value to string to simply indicate all ULs should persist with state being closed
ddtreemenu.setCookie(treeid, openuls.join(","), durationdays) //populate cookie with value treeid=1,2,3 etc (where 1,2... are the indexes of the opened ULs)
}
////A few utility functions below//////////////////////
ddtreemenu.getCookie=function(Name){ //get cookie value
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return ""
}
ddtreemenu.setCookie=function(name, value, days){ //set cookei value
var expireDate = new Date()
//set "expstring" to either future or past date, to set or delete cookie, respectively
var expstring=expireDate.setDate(expireDate.getDate()+parseInt(days))
document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";
}
ddtreemenu.searcharray=function(thearray, value){ //searches an array for the entered value. If found, delete value from array
var isfound=false
for (var i=0; i<thearray.length; i++){
if (thearray[i]==value){
isfound=true
thearray.shift() //delete this element from array for efficiency sake
break
}
}
return isfound
}
ddtreemenu.preventpropagate=function(e){ //prevent action from bubbling upwards
if (typeof e!="undefined")
e.stopPropagation()
else
event.cancelBubble=true
}
ddtreemenu.dotask=function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
}

View File

@ -1,242 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require_once("headers.php");
require_once("upper.php");
$html->set_body('<h2>'.$logger_overview[$lang].'</h2>');
if ($_GET[a]) {
$offset_start=$_GET[a];
if (!ctype_digit($offset_start)) {
unset($offset_start);
}
}
if (isset($_POST['e']) AND isset($_POST['l'])) {
$event_id=$_POST['e'];
$level_id=$_POST['l'];
}
else{
$event_id=$_GET['e'];
$level_id=$_GET['l'];
}
if (!ctype_digit($event_id) AND !ctype_digit($level_id)) {
unset($level_id);
unset($event_id);
}
$html->set_body('<div align="center">
<form method="post" action="logger.php">
<select name="e" class="cc3">
<option value="none">--- select event ---
');
$html->set_body('<option value="1"');
if ($event_id=="1") {
$html->set_body(' "selected"');
}
$html->set_body(' >Login<option value="2"');
if ($event_id=="2") {
$html->set_body('"selected"');
}
$html->set_body(' >Logout<option value="3"');
if ($event_id=="3") {
$html->set_body('"selected"');
}
$html->set_body(' >Login failed<option value="4"');
if ($event_id=="4") {
$html->set_body('"selected"');
}
$html->set_body(' >Chat deletion<option value="5"');
if ($event_id=="5") {
$html->set_body('"selected"');
}
$html->set_body('>Entire archive deletion<option value="6"');
if ($event_id=="6") {
$html->set_body('"selected"');
}
$html->set_body( ' >Turn off archivization<option value="7"');
if ($event_id=="7") {
$html->set_body('"selected"');
}
$html->set_body( ' >Turn on archivization<option value="8"');
if ($event_id=="8") {
$html->set_body('"selected"');
}
$html->set_body(' >Chat exports
</select>&nbsp;
<select name="l" class="cc3">
<option value="none">--- select level ---
');
$html->set_body('<option value="1"');
if ($level_id=="1") {
$html->set_body('"selected"');
}
$html->set_body('>normal<option value="2"');
if ($level_id=="2") {
$html->set_body('"selected"');
}
$html->set_body('>warning<option value="3"');
if ($level_id=="3") {
$html->set_body('"selected"');
}
$html->set_body('>alert</select>
<input type="submit" name="filter_commit" value="Filter">
</form>
</div>
<center>
<table id="maincontent" class="ff" align="center" border="0" colspan="0" cellspacing="0" >
<tr class="header"><td style="padding-left: 5px; padding-right: 0px;">'.$logger_f1[$lang].'</td>
<td style="padding-left: 0px; padding-right: 10px;">'.$logger_f2[$lang].'</td>
<td style="padding-left: 0px; padding-right: 10px;">'.$logger_f3[$lang].'</td>
<td style="padding-left: 0px; padding-right: 10px;">'.$logger_f4[$lang].'</td></tr>
<tr class="spacer"><td colspan="4"></td></tr>
<tbody id="searchfield">
');
if (!$offset_start) {
$offset_start="0";
}
if ($event_id === "none") {
$event_id = null;
}
if ($level_id === "none") {
$level_id = null;
}
$db->get_num_events($event_id,$level_id);
$nume = $db->result->cnt;
if ($offset_start>$nume) {
$offset_start="0";
}
$db->logger_get_events($event_id,$level_id, $offset_start,$lang);
$result = $db->result;
foreach ($result as $results) {
if ($results[id_event]=="1" OR $results[id_event]=="3") {
$ip_desc=$logger_f_ip[$lang];
}
else {
$ip_desc="";
}
if ($results[id_level] == "3") {
$col="main_row_b";
$f_color="style=\"color: red;\"";
}
else {
$col="main_row_a";
$f_color="";
}
$html->set_body('<tr class="'.$col.'" '.$f_color.'><td style="padding-left: 0px; padding-right: 10px;">'.$results[event].'</td>
<td>'.$results[log_time].'</td>
<td style="text-align: center;">'.$results[level].'</td>
<td style="padding-left: 5px;">'.htmlspecialchars($ip_desc.$results[extra]).'</td></tr>
');
}
$html->set_body('</tbody>');
// pagination
$html->set_body('<tr class="spacer" height="1px"><td colspan="4"></td></tr><tr class="foot"><td style="text-align: center;" colspan="4">');
for($i=0;$i < $nume;$i=$i+300){
if ($i!=$offset_start) {
if (isset($event_id)){
$e="&e=$event_id";
}
if (isset($level_id)){
$l="&l=$level_id";
}
$html->set_body('<a href="?a='.$i.$e.$l.'"> <b>['.$i.']</b> </font></a>');
}
else {
$html->set_body(' -'.$i.'- ');
}
}
$html->set_body('</td></tr></table></center>');
require_once("footer.php");
?>

View File

@ -1,536 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require_once("headers.php");
require_once("upper.php");
// fetch some date from encoded url...
$e_string = $_GET['a'];
$resource_id = $_GET['b'];
$start = $_GET['start'];
if ($_GET[a]) {
$jump_link = "&a=".$_GET['a'];
}
$html->set_overview('<h2>'.$archives_t[$lang].'</h2><small>'.$cal_notice[$lang].'. <a href="calendar_view.php?set_pref=1&amp;v=2'.$jump_link.'"><u>'.$change_view_cal[$lang].'</u></a></small>');
if ($enc->decrypt_url($e_string) === true) {
$tslice = $enc->tslice;
$talker = $enc->peer_name_id;
$server = $enc->peer_server_id;
$action = $enc->action;
$lnk = $enc->lnk;
$e_string = $enc->crypt_url("tslice=$tslice&peer_name_id=$talker&peer_server_id=$server");
}
else{
unset($e_string);
}
$html->set_body('
<script language="javascript" type="text/javascript">
// prepare the form when the DOM is ready
$(document).ready(function() {
// bind form using ajaxForm
$(\'#fav_form\').ajaxForm({
// target identifies the element(s) to update with the server response
target: \'#fav_result\',
// success identifies the function to invoke when the server response
// has been received; here we apply a fade-in effect to the new content
success: function() {
$(\'#fav_result\').fadeIn(\'slow\');
}
});
});
</script>
');
// undo delete
if ($action === "undelete") {
if ($db->move_chat_from_trash($talker,$server,$tslice,$lnk) === true) {
$html->status_message($undo_info[$lang],"message");
}
else {
unset($talker);
$html->alert_message($oper_fail[$lang],"message");
}
}
// set idx
if ($_GET['idx']) {
$idx = $_GET['idx'];
if ($enc->decrypt_url($idx) === true) {
if($db->set_ext_index($enc->single) !== true) {
echo $enc->single;exit;
unset($idx);
unset($action);
}
$idx = $enc->single;
}
else{
unset($idx);
unset($action);
}
}
if ($action === "delete") {
if ($db->move_chat_to_trash($talker,$server,$tslice,$lnk) === true) {
$undo = $enc->crypt_url("tslice=$tslice&peer_name_id=$talker&peer_server_id=$server&lnk=$lnk&action=undelete");
unset($talker);
$idx = $enc->crypt_url("single=".$db->get_last_idx()."");
$html->set_body('<center><div style="background-color: #fad163; text-align: center; width: 240pt;">'.$del_moved[$lang]
.'<a href="'.$view_type.'?a='.$undo.'&amp;idx='.$idx.'"> <span style="color: blue; font-weight: bold;"><u>Undo</u></span></a></div></center>');
}
else {
$html->alert_message($oper_fail[$lang],"message");
unset($talker);
}
}
// some validation things...
if ($start) {
if ((validate_start($start))!==true) {
$start="0";
}
}
$db->get_user_stats_drop_down();
$result = $db->result;
if (count($result) !=0) {
// main table
$html->set_body('<br><br><table class="ff" border="0">
<tr class="main_s"><td colspan="1" style="text-align:left;">'.$main_date[$lang].'</td>
');
if ($tslice) {
$html->set_body('<td>'.$talks[$lang].'</td>');
}
if ($talker) {
$html->set_body('<td>'.$thread[$lang].'</td>');
}
$html->set_body('<tr><td valign="top"><table border="0" class="ff"><tr><td rowspan="3" valign="top"><ul id="treemenu2" class="treeview" style="padding: 0px;">');
foreach ($result as $entry) {
if ($entry[at_send]==substr($tslice,0,7)) {
$rel="open"; $bop="<b>"; $bcl="</b>";
}
else {
$rel="";
$bop="";
$bcl="";
}
$html->set_body('<li>'.$bop.verbose_date($entry[at],$months_names,$weekdays,false,true).$bcl.'<ul rel="'.$rel.'">');
$db->get_folder_content($entry[at_send]);
$result2 = $db->result;
foreach($result2 as $ent) {
$to_base = $enc->crypt_url("tslice=$ent[at]");
if ($tslice==$ent["at"]) {
$bold_b = "<b>";
$bold_e="</b>";
}
else {
$bold_b="";
$bold_e="";
}
$html->set_body('<li><a href="?a='.$to_base.'">'.$bold_b.verbose_date($ent["at"],$months_names,$weekdays,true).$bold_e.'</a></li>');
}
$html->set_body('</ul></li>');
}
$html->set_body('
</ul>
<script type="text/javascript">
ddtreemenu.createTree("treemenu2", false, 1)
</script>
');
$html->set_body('</td></tr></table>');
}
else {
$html->status_message($no_archives[$lang]);
}
// Chats in selected days:
if ($tslice) {
$db->get_user_chats($tslice);
$result = $db->result;
if (count($result)>0) {
$display_conversations = true;
}
else{
$display_conversations = false;
}
if ($display_conversations === true) {
// we need to sort list by nickname so we need to combiet 2 results: roster and mod_logdb chatlist:
foreach($result as $sort_me) {
$roster_name = query_nick_name($ejabberd_roster,$sort_me[username],$sort_me[server_name]);
$arr_key++;
if (!$roster_name) {
// split contact into 2 arrays: one with full jids, second without names - transports, agents..
$sorted_spec[$arr_key] = array(
"roster_name"=>$roster_name,
"username"=>$sort_me[username],
"server_name"=>$sort_me[server_name],
"todaytalk"=>$sort_me[todaytalk],
"server"=>$sort_me[server],
"lcount"=>$sort_me[lcount]
);
}
else {
$sorted_list[$arr_key] = array(
"roster_name"=>$roster_name,
"username"=>$sort_me[username],
"server_name"=>$sort_me[server_name],
"todaytalk"=>$sort_me[todaytalk],
"server"=>$sort_me[server],
"lcount"=>$sort_me[lcount]
);
}
}
// sort list
asort($sorted_list);
if (!$show_spec) {
$show_spec="1";
}
if ($sorted_spec AND $show_spec === "1") {
if ($sorted_list) {
$sorted_list = array_merge($sorted_list,$sorted_spec);
}
else{
$sorted_list = $sorted_spec;
}
}
$html->set_body('<td valign="top" style="padding-top: 15px;">
<table class="ff">');
foreach ($sorted_list as $entry) {
$user_name = $entry[username];
$server_name = $entry[server_name];
if ($talker == $entry["todaytalk"] AND $server==$entry[server]) {
$bold_b="<b>"; $bold_e="</b>";
}
else {
$bold_b="";
$bold_e="";
}
$nickname = $entry[roster_name];
if (!$nickname) {
$nickname=$not_in_r[$lang];
unset($malpa);
$calday_class="caldays4";
$spec_con = '<br><span style="text-indent: 10px; font-size: smaller;">(<i>'.htmlspecialchars($server_name).'</i>)</span>';
}
else{
$malpa = "@";
unset($spec_con);
unset($calday_class);
}
$to_base2 = $enc->crypt_url("tslice=$tslice&peer_name_id=$entry[todaytalk]&peer_server_id=$entry[server]");
$html->set_body('<tr>
<td><a class="'.$calday_class.'" id="pretty" href="?a='.$to_base2.'" title="JabberID:;'.htmlspecialchars($user_name).$malpa.htmlspecialchars($server_name).'">
'.$bold_b.cut_nick($nickname).$bold_e.'</a>');
if ($spec_con) {
$html->set_body($bold_b.$spec_con.$bold_e);
}
$html->set_body('</td></tr>');
}
$html->set_body('</table></td>');
}
}
// Chat thread:
if ($talker) {
$html->set_body('<td valign="top"><table border="0" class="ff"><tr>');
if (!$start) {
$start="0";
}
$db->get_num_lines($tslice,$talker,$server);
$nume = $db->result->cnt;
if ($start>$nume) {
$start=$nume-$num_lines_bro;
}
$db->get_user_name($talker);
$talker_name = $db->result->username;
$db->get_server_name($server);
$server_name = $db->result->server_name;
$nickname = query_nick_name($ejabberd_roster,$talker_name,$server_name);
if ($nickname === "") {
$nickname=$not_in_r[$lang];
$spec_mark = true;
}
else {
$spec_mark = false;
}
$predefined = $enc->crypt_url("jid=$talker_name@$server_name");
$html->set_body('<table id="maincontent" border="0" cellspacing="0" class="ff"><tr><td colspan="4"><div id="fav_result"></div></td></tr>');
if ($_GET['loc']) {
$loc_id=$_GET['loc'];
if ($loc_id=="2") {
$back_link_message=$chat_map_back[$lang];
$back_link="chat_map.php?chat_map=$predefined";
}
elseif($loc_id=="3") {
$back_link_message=$fav_back[$lang];
$back_link="favorites.php";
}
elseif($loc_id=="4") {
$back_link_message=$myl_back[$lang];
$back_link="my_links.php";
}
$html->set_body('<tr><td colspan="2" class="message"><a href="'.$back_link.'">'.$back_link_message.'</a></td><td></td></tr>');
}
if ($resource_id) {
$db->get_resource_name($resource_id);
$res_display = $db->result->resource_name;
$html->set_body('<tr><td colspan="4"><div style="background-color: #fad163; text-align: center; font-weight: bold;">'.$resource_warn[$lang].cut_nick(htmlspecialchars($res_display)).'. ');
$html->set_body($resource_discard[$lang].'<a class="export" href="?a='.$e_string.'">'.$resource_discard2[$lang].'</a></div></td></tr>');
}
$action_link = $enc->crypt_url("tslice=$tslice&peer_name_id=$talker&peer_server_id=$server&lnk=$e_string&action=delete");
$html->set_body('<tr style="background-image: url(img/bar_bg.png); background-repeat:repeat-x;">
<td><b> '.$time_t[$lang].' </b></td><td><b> '.$user_t[$lang].' </b></td><td><b> '.$thread[$lang].'</b></td>
<td align="right" style="padding-right: 5px; font-weight: normal;">
');
// check favorite
$db->check_favorite($talker,$server,$tslice);
if ($db->result->cnt < 1) {
$html->set_body('
<form style="margin-bottom: 0;" action="favorites.php" method="post">
<input type="hidden" name="a" value="'.$_GET[a].'">
<input type="hidden" name="init" value="1">
<input class="fav_main" type="submit" value="'.$fav_add[$lang].'">
</form>
');
}
else {
$html->set_body('
<form style="margin-bottom: 0;" action="favorites.php" method="post">
<input type="hidden" name="a" value="'.$_GET[a].'">
<input type="hidden" name="init" value="1">
<i>'.$fav_favorited[$lang].'</i>
</form>
');
}
$html->set_body('
<a id="pretty" title="'.$tip_export[$lang].'" class="foot" href="export.php?a='.$e_string.'">'.$export_link[$lang].'</a>&nbsp; | &nbsp;
<font color="#65a5e4">'.$all_for_u[$lang].'</font>
<a id="pretty" title="'.$all_for_u_m2_d[$lang].'" class="foot" href="chat_map.php?chat_map='.$predefined.'"><u>'.$all_for_u_m2[$lang].'</u></a>
&nbsp;<small>|</small>&nbsp;
<a id="pretty" title="'.$all_for_u_m_d[$lang].'" class="foot" href="search_v2.php?b='.$predefined.'"><u>'.$all_for_u_m[$lang].'</u></a>
&nbsp; | &nbsp;
<a id="pretty" title="'.$tip_delete[$lang].'" class="foot" href="main.php?a='.$action_link.'">'.$del_t[$lang].'</a></td></tr>
<tr class="spacer"><td colspan="6"></td></tr>
<tbody id="searchfield">
');
if($db->get_user_chat($tslice,$talker,$server,$resource_id,$start,$num_lines_bro) === false) {
$html->alert_message($oper_fail[$lang]);
}
// processing messages. this should be handled as separate message_processor, so that tree view and calendar view can share the same code withoud redundancy. To be done in 2.0
$result = $db->result;
// some strings to pass to message_processor
$lang_pack = array(
$cont_chat_p[$lang],
$message_type_message[$lang],
$message_type_error[$lang],
$message_type_headline[$lang],
$resource_only[$lang],
$muc_message[$lang],
$my_links_save[$lang],
$verb_h[$lang],
$in_min[$lang]
);
// Sent all data to parsing function (message processor)
if (message_processor($tslice,$server_name,$start,$nickname,$result,$db,$html,$enc,TOKEN,$split_line,$lang_pack,$lang,$spec_mark,$e_string) !== true) {
$html->alert_message($oper_fail[$lang]);
$html->destroy_content();
}
$html->set_body('</tbody><tr class="spacer" height="1px"><td colspan="6"></td></tr><tr style="background-image: url(img/bar_bg.png); background-repeat:repeat-x;"><td style="text-align: center;" colspan="9">');
for($i=0;$i < $nume;$i=$i+$num_lines_bro){
if ($i!=$start) {
if ($resource_id) {
$add_res="&b=$resource_id";
}
else {
$add_res="";
}
$html->set_body('<a href="?a='.$e_string.$add_res.'&start='.$i.'"> <b>['.$i.']</b> </font></a>');
}
else {
$html->set_body(' -'.$i.'- ');
}
}
$html->set_body('</td></tr>');
// limiting code - end
if (($nume-$start)>40) {
$html->set_body('<tr><td colspan="6" style="text-align: right; padding-right: 5px;"><a href="#top"><small>'.$back_t[$lang].'</small></a></td></tr>');
}
$html->set_body('</table></tr></table></td>');
}
$html->set_body('</td></tr></table>');
require_once("footer.php");
?>

View File

@ -1,180 +0,0 @@
Index: mysql_conn.erl
===================================================================
--- mysql_conn.erl (revision 861)
+++ mysql_conn.erl (working copy)
@@ -64,6 +64,7 @@
%% External exports
%%--------------------------------------------------------------------
-export([start/6,
+ start/7,
start_link/6,
fetch/3,
fetch/4,
@@ -99,12 +100,14 @@
%%--------------------------------------------------------------------
%% Function: start(Host, Port, User, Password, Database, LogFun)
+%% Function: start(Host, Port, User, Password, Database, UserFlags, LogFun)
%% Function: start_link(Host, Port, User, Password, Database, LogFun)
%% Host = string()
%% Port = integer()
%% User = string()
%% Password = string()
%% Database = string()
+%% UserFlags = list()
%% LogFun = undefined | function() of arity 3
%% Descrip.: Starts a mysql_conn process that connects to a MySQL
%% server, logs in and chooses a database.
@@ -112,11 +115,13 @@
%% Pid = pid()
%% Reason = string()
%%--------------------------------------------------------------------
-start(Host, Port, User, Password, Database, LogFun) when is_list(Host), is_integer(Port), is_list(User),
- is_list(Password), is_list(Database) ->
+start(Host, Port, User, Password, Database, LogFun) ->
+ start(Host, Port, User, Password, Database, [], LogFun).
+start(Host, Port, User, Password, Database, UserFlags, LogFun) when is_list(Host), is_integer(Port), is_list(User),
+ is_list(Password), is_list(Database), is_list(UserFlags) ->
ConnPid = self(),
Pid = spawn(fun () ->
- init(Host, Port, User, Password, Database, LogFun, ConnPid)
+ init(Host, Port, User, Password, Database, UserFlags, LogFun, ConnPid)
end),
post_start(Pid, LogFun).
@@ -124,7 +129,7 @@
is_list(Password), is_list(Database) ->
ConnPid = self(),
Pid = spawn_link(fun () ->
- init(Host, Port, User, Password, Database, LogFun, ConnPid)
+ init(Host, Port, User, Password, Database, [], LogFun, ConnPid)
end),
post_start(Pid, LogFun).
@@ -243,6 +248,7 @@
%% User = string()
%% Password = string()
%% Database = string()
+%% UserFlags = list()
%% LogFun = undefined | function() of arity 3
%% Parent = pid() of process starting this mysql_conn
%% Descrip.: Connect to a MySQL server, log in and chooses a database.
@@ -250,10 +256,10 @@
%% we were successfull.
%% Returns : void() | does not return
%%--------------------------------------------------------------------
-init(Host, Port, User, Password, Database, LogFun, Parent) ->
+init(Host, Port, User, Password, Database, UserFlags, LogFun, Parent) ->
case mysql_recv:start_link(Host, Port, LogFun, self()) of
{ok, RecvPid, Sock} ->
- case mysql_init(Sock, RecvPid, User, Password, LogFun) of
+ case mysql_init(Sock, RecvPid, User, Password, UserFlags, LogFun) of
{ok, Version} ->
case do_query(Sock, RecvPid, LogFun, "use " ++ Database, Version, [{result_type, binary}]) of
{error, MySQLRes} ->
@@ -318,7 +324,7 @@
end.
%%--------------------------------------------------------------------
-%% Function: mysql_init(Sock, RecvPid, User, Password, LogFun)
+%% Function: mysql_init(Sock, RecvPid, User, Password, UserFlags, LogFun)
%% Sock = term(), gen_tcp socket
%% RecvPid = pid(), mysql_recv process
%% User = string()
@@ -328,16 +334,16 @@
%% Returns : ok | {error, Reason}
%% Reason = string()
%%--------------------------------------------------------------------
-mysql_init(Sock, RecvPid, User, Password, LogFun) ->
+mysql_init(Sock, RecvPid, User, Password, UserFlags, LogFun) ->
case do_recv(LogFun, RecvPid, undefined) of
{ok, Packet, InitSeqNum} ->
{Version, Salt1, Salt2, Caps} = greeting(Packet, LogFun),
AuthRes =
case Caps band ?SECURE_CONNECTION of
?SECURE_CONNECTION ->
- mysql_auth:do_new_auth(Sock, RecvPid, InitSeqNum + 1, User, Password, Salt1, Salt2, LogFun);
+ mysql_auth:do_new_auth(Sock, RecvPid, InitSeqNum + 1, User, Password, UserFlags, Salt1, Salt2, LogFun);
_ ->
- mysql_auth:do_old_auth(Sock, RecvPid, InitSeqNum + 1, User, Password, Salt1, LogFun)
+ mysql_auth:do_old_auth(Sock, RecvPid, InitSeqNum + 1, User, Password, UserFlags, Salt1, LogFun)
end,
case AuthRes of
{ok, <<0:8, _Rest/binary>>, _RecvNum} ->
Index: mysql_auth.erl
===================================================================
--- mysql_auth.erl (revision 861)
+++ mysql_auth.erl (working copy)
@@ -17,8 +17,8 @@
%% External exports (should only be used by the 'mysql_conn' module)
%%--------------------------------------------------------------------
-export([
- do_old_auth/7,
- do_new_auth/8
+ do_old_auth/8,
+ do_new_auth/9
]).
%%--------------------------------------------------------------------
@@ -51,9 +51,9 @@
%% Descrip.: Perform old-style MySQL authentication.
%% Returns : result of mysql_conn:do_recv/3
%%--------------------------------------------------------------------
-do_old_auth(Sock, RecvPid, SeqNum, User, Password, Salt1, LogFun) ->
+do_old_auth(Sock, RecvPid, SeqNum, User, Password, UserFlags, Salt1, LogFun) ->
Auth = password_old(Password, Salt1),
- Packet2 = make_auth(User, Auth),
+ Packet2 = make_auth(User, Auth, UserFlags),
do_send(Sock, Packet2, SeqNum, LogFun),
mysql_conn:do_recv(LogFun, RecvPid, SeqNum).
@@ -71,9 +71,9 @@
%% Descrip.: Perform MySQL authentication.
%% Returns : result of mysql_conn:do_recv/3
%%--------------------------------------------------------------------
-do_new_auth(Sock, RecvPid, SeqNum, User, Password, Salt1, Salt2, LogFun) ->
+do_new_auth(Sock, RecvPid, SeqNum, User, Password, UserFlags, Salt1, Salt2, LogFun) ->
Auth = password_new(Password, Salt1 ++ Salt2),
- Packet2 = make_new_auth(User, Auth, none),
+ Packet2 = make_new_auth(User, Auth, none, UserFlags),
do_send(Sock, Packet2, SeqNum, LogFun),
case mysql_conn:do_recv(LogFun, RecvPid, SeqNum) of
{ok, Packet3, SeqNum2} ->
@@ -105,9 +105,11 @@
end, L)).
%% part of do_old_auth/4, which is part of mysql_init/4
-make_auth(User, Password) ->
- Caps = ?LONG_PASSWORD bor ?LONG_FLAG
- bor ?TRANSACTIONS bor ?FOUND_ROWS,
+make_auth(User, Password, UserFlags) ->
+ Flags = lists:append(UserFlags, [?LONG_PASSWORD, ?LONG_FLAG, ?TRANSACTIONS, ?FOUND_ROWS]),
+ Caps = lists:foldl(fun(Flag, TCaps) when is_integer(Flag) ->
+ TCaps bor Flag
+ end, 0, Flags),
Maxsize = 0,
UserB = list_to_binary(User),
PasswordB = Password,
@@ -115,16 +117,18 @@
PasswordB/binary>>.
%% part of do_new_auth/4, which is part of mysql_init/4
-make_new_auth(User, Password, Database) ->
+make_new_auth(User, Password, Database, UserFlags) ->
DBCaps = case Database of
none ->
0;
_ ->
?CONNECT_WITH_DB
end,
- Caps = ?LONG_PASSWORD bor ?LONG_FLAG bor ?TRANSACTIONS bor
- ?PROTOCOL_41 bor ?SECURE_CONNECTION bor DBCaps
- bor ?FOUND_ROWS,
+
+ Flags = lists:append(UserFlags, [?LONG_PASSWORD, ?LONG_FLAG, ?TRANSACTIONS, ?PROTOCOL_41, ?SECURE_CONNECTION, DBCaps, ?FOUND_ROWS]),
+ Caps = lists:foldl(fun(Flag, TCaps) when is_integer(Flag) ->
+ TCaps bor Flag
+ end, DBCaps, Flags),
Maxsize = ?MAX_PACKET_SIZE,
UserB = list_to_binary(User),
PasswordL = size(Password),

File diff suppressed because it is too large Load Diff

View File

@ -1,65 +0,0 @@
Index: mod_logdb.erl
===================================================================
--- mod_logdb.erl (revision 1273)
+++ mod_logdb.erl (working copy)
@@ -126,7 +126,7 @@
purge_older_days=gen_mod:get_opt(purge_older_days, Opts, never),
poll_users_settings=PollUsersSettings}}.
-cleanup(#state{vhost=VHost} = State) ->
+cleanup(#state{vhost=VHost} = _State) ->
?MYDEBUG("Stopping ~s for ~p", [?MODULE, VHost]),
%ets:delete(ets_settings_table(VHost)),
@@ -153,14 +153,14 @@
?MYDEBUG("Removed hooks for ~p", [VHost]),
- ejabberd_ctl:unregister_commands(VHost, [{"rebuild_stats", "rebuild mod_logdb module stats for vhost"}], ?MODULE, rebuild_stats),
- Supported_backends = lists:flatmap(fun({Backend, _Opts}) ->
- [atom_to_list(Backend), " "]
- end, State#state.dbs),
- ejabberd_ctl:unregister_commands(
- VHost,
- [{"copy_messages backend", "copy messages from backend to current backend. backends could be: " ++ Supported_backends }],
- ?MODULE, copy_messages_ctl),
+ %ejabberd_ctl:unregister_commands(VHost, [{"rebuild_stats", "rebuild mod_logdb module stats for vhost"}], ?MODULE, rebuild_stats),
+ %Supported_backends = lists:flatmap(fun({Backend, _Opts}) ->
+ % [atom_to_list(Backend), " "]
+ % end, State#state.dbs),
+ %ejabberd_ctl:unregister_commands(
+ % VHost,
+ % [{"copy_messages backend", "copy messages from backend to current backend. backends could be: " ++ Supported_backends }],
+ % ?MODULE, copy_messages_ctl),
?MYDEBUG("Unregistered commands for ~p", [VHost]).
stop(VHost) ->
@@ -388,17 +388,17 @@
?MYDEBUG("Added hooks for ~p", [VHost]),
- ejabberd_ctl:register_commands(
- VHost,
- [{"rebuild_stats", "rebuild mod_logdb module stats for vhost"}],
- ?MODULE, rebuild_stats),
- Supported_backends = lists:flatmap(fun({Backend, _Opts}) ->
- [atom_to_list(Backend), " "]
- end, State#state.dbs),
- ejabberd_ctl:register_commands(
- VHost,
- [{"copy_messages backend", "copy messages from backend to current backend. backends could be: " ++ Supported_backends }],
- ?MODULE, copy_messages_ctl),
+ %ejabberd_ctl:register_commands(
+ % VHost,
+ % [{"rebuild_stats", "rebuild mod_logdb module stats for vhost"}],
+ % ?MODULE, rebuild_stats),
+ %Supported_backends = lists:flatmap(fun({Backend, _Opts}) ->
+ % [atom_to_list(Backend), " "]
+ % end, State#state.dbs),
+ %ejabberd_ctl:register_commands(
+ % VHost,
+ % [{"copy_messages backend", "copy messages from backend to current backend. backends could be: " ++ Supported_backends }],
+ % ?MODULE, copy_messages_ctl),
?MYDEBUG("Registered commands for ~p", [VHost]),
NewState=State#state{monref = MonRef, backendPid=SPid, purgeRef=TrefPurge, pollRef=TrefPoll},

View File

@ -1,48 +0,0 @@
mod_logdb by Oleg Palij
-----------------------
*NOTE* - Jorge is compatible only with the distributed mod_logdb. Please follow instruction below carefully.
Instalation instruction:
1) Grab ejabberd from SVN (Tested with Revision: 1868, but probably will work with any newer) or ejabberd 2.x
2) Patch mysql erlang driver with userflags patch
3) Patch sources of ejabberd using "patch" tool
(f.e: patch -p0 < patch-src-mod_logdb_svn)
4) Setup mysql5 database (dbname, username, etc...).
Db schema will be automaticaly setup during mod_logdb startup.
5) Edit config of your ejabberd server by adding following lines into modules section:
6) If you are using mysql5 backend with procedural language *you must patch* mysql driver with provided patch: userflags.diff, and add user priviledges for creating views (CREATE VIEW)
{modules, [
...
{mod_logdb,
[{vhosts, [{"your_xmpp_server", mysql5}]},
{dbs, [{mysql5, [{user, "db_username"},
{password, "db_password"},
{server, "ip_of_the_db_server"},
{port, 3306},
{db, "db_name"}
]
}]},
{groupchat, none},
{purge_older_days, never},
{ignore_jids, ["example@jid.pl", "example2@jid.pl"]},
{dolog_default, false}
]
},
...
]}.
And for ad-hoc commands, add on the top of the config file:
{access, mod_logdb, [{allow, all}]}.
{access, mod_logdb_admin, [{allow, admin}]}.
7) Restart the server
8) Have fun
For further info consult mod_logdb manual.
Note for admins who use clustered setup: you need to install mod_logdb on each ejabberd node.
Multiple mod_logdb sessions can share database access without any problems.

View File

@ -1,193 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require_once("headers.php");
require_once("upper.php");
$tigger = $_POST['trigger'];
$desc = $_POST['desc'];
$del = $_GET['del'];
$link_id = $_GET['link_id'];
if ($_GET[a]) {
if ($enc->decrypt_url($_GET[a]) === true) {
$variables[tslice] = $enc->tslice;
$variables[peer_name_id] = $enc->peer_name_id;
$variables[peer_server_id] = $enc->peer_server_id;
$variables[lnk] = $enc->lnk;
$variables[linktag] = $enc->linktag;
$variables[strt] = $enc->strt;
$variables[ismylink] = $enc->ismylink;
}
else {
unset($variables);
}
}
if ($del === "t") {
if ($db->del_mylink($link_id) === true) {
$html->status_message($my_links_removed[$lang]);
// recount number of links
$db->get_mylinks_count();
$my_links_count = $db->result->cnt;
}
else {
$html->alert_message($oper_fail[$lang]);
}
}
if ($tigger === $my_links_commit[$lang]) {
if ($enc->decrypt_url($_POST[hidden_field]) === true) {
$peer_name_id = $enc->peer_name_id;
$peer_server_id = $enc->peer_server_id;
$datat = $enc->tslice;
$lnk = $enc->lnk;
$strt = $enc->strt;
$linktag = $enc->linktag;
$link = $lnk."&start=$strt#$linktag";
if ($desc === $my_links_optional[$lang]) {
$desc = $my_links_none[$lang];
}
$desc = substr($desc,0,120);
if($db->add_mylink($peer_name_id,$peer_server_id,$datat,$link,$desc) === true) {
$html->status_message($my_links_added[$lang].'
<br><a href="'.$view_type.'?a='.$link.'" style="color: blue;"><b>'.$my_links_back[$lang].'</b></a></div></center>');
// recount number of links
$db->get_mylinks_count();
$my_links_count = $db->result->cnt;
}
else{
$html->alert_message($oper_fail[$lang]);
}
}
}
if ($variables[ismylink] === "1") {
$db->get_server_name($enc->peer_server_id);
$sname = $db->result->server_name;
$db->get_user_name($enc->peer_name_id);
$uname = $db->result->username;
$nickname=query_nick_name($ejabberd_roster,$uname,$sname);
$jid=''.$uname.'@'.$sname.'';
$hidden_fields = $enc->crypt_url("tslice=$enc->tslice&peer_name_id=$variables[peer_name_id]&peer_server_id=$variables[peer_server_id]&lnk=$variables[lnk]&strt=$variables[strt]&linktag=$variables[linktag]");
if (!$nickname) {
$nickname = $not_in_r[$lang];
$jid = $sname;
}
$html->set_body('
<center>
'.$my_links_save_d[$lang].'<br />
<table class="ff" border="0" cellspacing="0">
<form action="my_links.php" method="post">
<tr><td height="5"></td></tr>
<tr class="main_row_b"><td style="text-align:center;">'.$my_links_chat[$lang].'&nbsp;&nbsp;
<b>'.cut_nick($nickname).'</b> (<i>'.htmlspecialchars($jid).'</i>)</td></tr>
<tr><td height="5"></td></tr>
<tr><td colspan="3" align="center"><textarea class="ccc" name="desc" rows="4">'.$my_links_optional[$lang].'</textarea></td></tr>
<tr><td colspan="3" align="center"><input name="trigger" class="red" type="submit" value="'.$my_links_commit[$lang].'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input class="red" type="button" value="'.$my_links_cancel[$lang].'" onClick="parent.location=\''.$view_type.'?a='.$enc->lnk.'&start='.htmlspecialchars($enc->strt).'#'.htmlspecialchars($enc->linktag).'\'"></td>
</tr><tr><td><input type="hidden" name="hidden_field" value="'.$hidden_fields.'"></form></table></center>
<br><br><br><br>
');
}
$html->set_overview('<h2>'.$my_links_desc_m[$lang].'</h2><small>'.$my_links_desc_e[$lang].'</small>');
if ($my_links_count === "0") {
$html->status_message($my_links_no_links[$lang]);
}
else {
$html->set_body('
<center><table id="maincontent" class="ff" cellspacing="0">
<tr class="header"><td>'.$my_links_link[$lang].'</td><td>'.$my_links_chat[$lang].'</td><td>'.$my_links_desc[$lang].'</td></tr>
<tr class="spacer" height="1px"><td colspan="4"></td></tr>
<tbody id="searchfield">
');
$db->get_mylink();
$result = $db->result;
foreach ($result as $entry) {
$db->get_user_name($entry[peer_name_id]);
$peer_name = $db->result->username;
$db->get_server_name($entry[peer_server_id]);
$peer_server = $db->result->server_name;
$nickname=query_nick_name($ejabberd_roster,$peer_name,$peer_server);
$desc = htmlspecialchars($entry[description]);
$jid = $peer_name.'@'.$peer_server;
if (!$nickname) {
$nickname = $not_in_r[$lang];
$jid = $peer_server;
}
$html->set_body('
<tr style="cursor: pointer;" bgcolor="#e8eef7" onMouseOver="this.bgColor=\'c3d9ff\';" onMouseOut="this.bgColor=\'#e8eef7\';">
<td onclick="window.location=\''.$view_type.'?loc=4&a='.$entry['link'].'\';" style="padding-left: 10px; padding-right: 10px">'.verbose_date($entry['datat'],$months_names).'</td>
<td onclick="window.location=\''.$view_type.'?loc=4&a='.$entry['link'].'\';">&nbsp;<b>'.cut_nick(htmlspecialchars($nickname)).'</b> ('.htmlspecialchars($jid).')&nbsp;</td>
<td onclick="window.location=\''.$view_type.'?loc=4&a='.$entry['link'].'\';">&nbsp;'.$desc.'</td>
<td><a href="my_links.php?del=t&link_id='.$entry[id_link].'" onClick="if (!confirm(\''.$del_conf_my_link[$lang].'\')) return false;" >&nbsp;'.$del_my_link[$lang].'&nbsp;</a></td>
</tr>
');
}
$html->set_body('
</tbody><tr class="spacer"><td colspan="4"></td></tr><tr class="foot"><td colspan="4" height="15"></td></tr></table></center>
');
}
require_once("footer.php");
?>

View File

@ -1,105 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require_once("headers.php");
// Redirect user if alredy setup
if ($sess->get('log_status')!== null) {
header("Location: index.php");
}
$action = $_POST[activate];
$user_name = $sess->get('uid_l');
if ($action === $activate_m[$lang]) {
if ($db->get_user_id($user_name) === true) {
if (!$db->result->user_id) {
$db->insert_user_id($user_name);
}
if ($db->insert_new_settings($user_name) === true) {
$html->set_body('<center><b>'.$act_su[$lang].'</b><br><small>'.$act_su2[$lang].'</small><hr>
<form action="calendar_view.php" method="get"><input class="red" type="submit" name="logout" value="'.$go_to_jorge[$lang].'"></form></center>
');
if ($db->get_user_id($user_name) === true) {
$user_id = $db->result->user_id;
$db->set_user_id($user_id);
// non critical error
if ($db->set_jorge_pref("1","2") === false OR $db->set_jorge_pref("2","1") === false) {
$html->alert_message('Ooops something goes wrong...its still beta...please contact system admin with this message');
}
$sess->set('log_status',true);
$sess->set('view_type','2');
$db->set_logger("7","1",$rem_adre);
}
else {
$html->alert_message('Ooops something goes wrong...its still beta...');
}
}
else {
$html->alert_message('Ooops something goes wrong...its still beta...');
}
}
else {
$html->alert_message('Ooops something goes wrong...its still beta...');
}
}
else {
$user_name=htmlspecialchars($user_name);
$html->set_body($act_info[$lang].'<b>'.$user_name.'</b> (<i>'.$user_name.'@'.XMPP_HOST.'</i>)<hr><br><br>
<center>
<form action="not_enabled.php" method="post">
<input class="red" type="submit" name="activate" value="'.$activate_m[$lang].'">
</form>
<br><br>'.$warning1[$lang].'<br><u>'.$devel_info[$lang].'</u></center><br><br>
<center>
<form action="index.php" method="get">
<input type="hidden" name="act" value="logout">
<input class="red" type="submit" name="destroy" value="'.$log_out_b[$lang].'">
</form>
</center>
');
}
require_once("footer.php");
?>

View File

@ -1,593 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require_once("headers.php");
$search_phase = $_POST['query'];
$next_link = $_GET['a']; // for pagination
$predefined = $_GET['b']; // for predefined
if ($predefined) {
if($enc->decrypt_url($predefined) === true) {
$search_phase = "from:".$enc->jid;
}
else {
unset($search_phase);
unset($predefined);
}
}
if ($next_link) {
if($enc->decrypt_url($next_link) === true) {
$tslice_next = $enc->tslice;
$search_phase = $enc->search_phase;
$offset_arch = $enc->offset_arch;
$offset_day = $enc->offset_day;
$tag_count = $enc->tag_count;
}
else {
unset ($next_link);
unset ($search_phase);
}
}
if ($tag_count=="t") {
$start_from = $offset_day;
}
else{
$start_from = null;
}
$plain_phase = $search_phase; // fix me
require_once("upper.php");
//need to initialize counter here
$r=0;
// Check if user have set up OwnName
$db->get_own_name();
if ($db->result->own_name) {
$own_name = $db->result->own_name;
}
else{
$own_name = false;
}
// we need to rewrite this part internaly...
if ($search_phase!="") {
// check if we are using parametrized search or not
$qquery = is_query_from($search_phase);
// parametric search
if ($qquery[from] == "t") {
$user_chat_search = "1"; // temp hack
unset($search_phase);
list($user_name, $server) = split("@", $qquery[talker]);
$db->get_user_id($user_name);
$user_name = $db->result->user_id;
$db->get_server_id($server);
$server = $db->result->server_id;
$search_phase=$qquery[query];
}
if ($search_phase) {
if ($db->create_search_results_table() === false) {
$html->alert_message($oper_fail[$lang]);
}
else {
$score="score";
}
}
//main table
if ($time2_start AND $time2_end) {
$html->status_message($search_warn[$lang].': '.$time2_start.' - '.$time2_end);
}
else {
$time2_start = null;
$time2_end = null;
}
$html->set_overview('<h2>'.$search_res[$lang].'</h2><table align="center" border="0" cellspacing="0" class="ff">
<tr class="header"><td width="150">'.$time_t[$lang].'</td><td>'.$talks[$lang].'</td><td>'.$thread[$lang].'</td><td>'.$score.'</td></tr>
<tr class="spacer"><td colspan="4"></td></tr>'
);
if ($offset_arch) {
$type_p="6";
}
else {
$type_p="1";
}
// run optimized query in specyfic conditions
if ($qquery[words]=="t" AND $qquery[from]=="t") {
$type_p="8";
}
if ($type_p==="1" OR $type_p==="8") {
$db->get_uniq_chat_dates($time2_start, $time2_end, false, $offset_arch, $user_name,$server);
}
elseif($type_p==="6") {
$db->get_uniq_chat_dates($time2_start, $time2_end, true, $offset_arch, $user_name,$server);
}
debug(DEBUG,"Selected search type: $type_p (first stage)");
$result = $db->result;
// query offsets init for calculations:
$arch_table = count($result);
$external=0;
$internal = $offset_day;
// set string for searching
if ($search_phase) {
$db->set_user_query($search_phase);
}
foreach($result as $entry) {
$external++;
$time_slice = $entry["at"];
// sub query
if ($search_phase) {
$type="4";
}
if ($user_chat_search) {
if ($qquery['words']=="t") {
$type="5";
}
elseif($qquery['words'] == "f") {
$type="7";
}
}
$a++;
if ($type==="4") {
$db->search_query($time_slice);
}
elseif($type==="5") {
$db->search_query_in_user_chat($user_name,$server,$time_slice,$start_from);
}
elseif($type==="7") {
$db-> search_query_chat_stream($user_name,$server,$time_slice,$start_from);
}
debug(DEBUG,"Selected search type: $type (second stage)");
$search_result = $db->result;
$num_rows = count($search_result);
$day_mark=0;
if ($num_rows!="0") {
foreach ($search_result as $results) {
// if there is no "from:" clausule perform normal search
if ($type!="7") {
$body = base64_encode($results[body]);
if ($db->insert_data_to_result_table (
$results[ts],
$time_slice,
$results[peer_name_id],
$results[peer_server_id],
$results[direction],
$body,
$results[score],
$results[ext]
) === false ) {
$html->alert_message($oper_fail[$lang]);
}
}
else {
$internal++;
$day_mark++;
// we like colors dont we?
if ($results["direction"] == "to") {
$col="e0e9f7";
}
else {
$col="e8eef7";
}
$to_user = $results["peer_name_id"];
$to_server=$results["peer_server_id"];
// let's make a link
$to_base = $enc->crypt_url("tslice=$time_slice&peer_name_id=$to_user&peer_server_id=$to_server");
// time calc
$pass_to_next = $results["ts"];
$new_d = $results["ts"];
$time_diff = abs((strtotime("$old_d") - strtotime(date("$new_d"))));
$old_d = $pass_to_next;
// split line
if ($time_diff>$split_line AND $day_mark>1 AND $type!="4") {
$in_minutes = round(($time_diff/60),0);
$html->set_body('<tr class="splitl">
<td colspan="5" style="font-size: 10px;">'.verbose_split_line($in_minutes,$verb_h[$lang],$in_min[$lang]).'<hr size="1" noshade="noshade" style="color: #cccccc;"></td></tr>');
}
// talker and server names
$db->get_user_name($results[peer_name_id]);
$talk = $db->result->username;
$db->get_server_name($results[peer_server_id]);
$sname = $db->result->server_name;
// cleaning username
$jid = htmlspecialchars($talk);
$html->set_body('<tr id="pretty" title="'.$jid.'@'.htmlspecialchars($sname).'"
style="cursor: pointer;" bgcolor="'.$col.'"
onclick="window.open(\''.$view_type.'?a='.$to_base.'\');"
onMouseOver="this.bgColor=\'c3d9ff\';"
onMouseOut="this.bgColor=\'#'.$col.'\';">
<td width="120" style="text-align: center;">'.$results["ts"].'</td>
');
// username from user roster
$talk = query_nick_name($ejabberd_roster,$talk,$sname);
// if there is no user in roster - advise that
if ($talk=="f") {
$talk=$not_in_r[$lang];
}
// threaded view
if ($results["direction"] == "from") {
$out=$talk;
$tt=$tt+1;
$aa=0;
}
else {
$out = TOKEN;
$aa=$aa+1;
$tt=0;
}
if ($aa<2 AND $tt<2) {
$html->set_body('<td style="text-align: left;">&nbsp;');
if ($out === TOKEN) {
if ($own_name !== false) {
$html->set_body(cut_nick(htmlspecialchars($own_name)));
}
else{
$html->set_body(cut_nick(htmlspecialchars($out)));
}
}
else {
$html->set_body(cut_nick(htmlspecialchars($out)));
}
$html->set_body('&nbsp;&nbsp;</td>');
}
else {
$html->set_body('<td style="text-align: right;"> -</td>');
}
// end threaded view
// message body
$body_message=wordwrap(str_replace("\n","<br>",htmlspecialchars($results["body"])),107,"<br>",true);
$html->set_body('<td width="700">'.$body_message.'</td>');
// run pagination code only if search contains from: clausule
/*
The pagination code havent been changed after upgrade to search_engine_v2 - it work well so if one want to improve it
f.e. by adding "back" button be my guest...current code is nightmare :/
*/
$r=$r+1;
debug(DEBUG,"all: $r, num_r: $num_rows, internal: $internal");
if ($r==$num_search_results) {
if ($num_rows>$internal) {
debug(DEBUG,"-->more results in this day...$entry[at] offset: $internal");
$tag_count="t";
}
$next_r=$external+$offset_arch;
debug(DEBUG,"before cutdown: $next_r");
// back to one day and continue with offset
if ($tag_count=="t") {
$next_r=$next_r-1;
}
debug(DEBUG,"after cutdown: $next_r");
debug(DEBUG,"Internal: $internal, offset: $offset_day, is_tag: $s_variables[tag_count]");
// if the same day - we increase offset
if ($internal==$offset_day AND $s_variables[tag_count] == "t") {
$internal=$internal+$offset_day;
debug(DEBUG,"Increasing offset...");
}
// hack
if ($qquery[from] == "t") {
$plain_phase=str_replace("@","//",$plain_phase);
}
$trange = $enc->crypt_url("time_start=$time2_start&time_end=$time2_end");
$lnk_n = $enc->crypt_url("tslice=$entry[at]&offset_arch=$next_r&offset_day=$internal&search_phase=$plain_phase&tag_count=$tag_count");
$html->set_body('<tr class="spacer"><td colspan="4"></td></tr>
<tr class="maint" style="background-image: url(img/bar_new.png); background-repeat:repeat-x; font-weight: bold; color: #fff;">
<td colspan="2" style="text-align: left;">
<a href="search_v2.php?a='.$lnk_p.'"></a></td>
<td colspan="2" style="text-align: right;">
<a href="search_v2.php?a='.$lnk_n.'&c='.$trange.'">'.$search_next[$lang].'</a></td></tr>
');
break 2;
}
}
}
}
else{
// if we haven't found anything increase counter by one...
$b++;
}
$start_from = null; // reset...
$internal=0;
$day_mark=1;
if ($num_rows!=0 AND $type=="7") {
if ($arch_table == $external) {
$html->set_body('<tr height="6" class="spacerb"><td colspan="3" style="text-align: center;"><small>'.$no_more[$lang].'</small></td></tr>');
}
elseif($type=="7") {
$html->set_body('<tr height="6" class="spacer"><td colspan="3" style="text-align: center;"><small>'.$nx_dy[$lang].'</small></td></tr>');
// initialize thread
$aa="0";
$tt="0";
}
}
// end of main loop
}
// if normal search:
if ($type!="7" AND $type!==NULL) {
$db->get_search_results();
$result = $db->result;
$num_results = count($result);
$html->set_body('<tr class="maint"><td colspan="4" style="text-align: center; font-weight: normal;">'.$search_tip[$lang].' <b>'.$num_results.'</b>'.$search_why[$lang].'</td></tr>
<tr class="spacerb"><td colspan="5"></td></tr>');
foreach ($result as $dat) {
//building link:
$to_base = $enc->crypt_url("tslice=$dat[time_slice]&peer_name_id=$dat[peer_name_id]&peer_server_id=$dat[peer_server_id]");
// get the name of user that we was talking to
$db->get_user_name($dat[peer_name_id]);
$talk = $db->result->username;
// get it's server name
$db->get_server_name($dat[peer_server_id]);
$sname = $db->result->server_name;
// cleanup jid
$jid = htmlspecialchars($talk);
// color every second line...
if ($col=="e0e9f7") {
$col="e8eef7";
}
else {
$col="e0e9f7";
}
// get username from user roster:
$talk = query_nick_name($ejabberd_roster,$talk,$sname);
// if user is not in list, advise about that
if ($talk === "" ) {
$talk=$not_in_r[$lang];
}
// now we want to know who was talking to who...
if ($dat["direction"] == "to") {
$fr=$to_u[$lang];
}
else {
$fr=$from_u[$lang];
}
// ... and what was talking, and format that ...
$body_talk = wordwrap(str_replace("\n","<br>",htmlspecialchars(base64_decode($dat["body"]))),107,"<br>",true);
// advise user if chat is deleted. Extension=1 stands for "Chat temporary deleted" or "Chat awaiting deletion"
if ($dat[ext] == 1) {
$html->set_body('<tr bgcolor="b5b5b5"><td colspan="4" style="text-align: center; font-weight: bold;">'.$marked_as_d[$lang].'</td></tr>');
}
// opening line
if ($dat[ext]!=1) {
$html->set_body('<tr id="pretty" title="'.$jid.'@'.htmlspecialchars($sname).'"
style="cursor: pointer;" bgcolor="'.$col.'" onclick="window.location=\''.$view_type.'?a='.$to_base.'\'"
onMouseOver="this.bgColor=\'c3d9ff\';" onMouseOut="this.bgColor=\'#'.$col.'\';">');
}
else {
$html->set_body('<tr id="pretty" title="'.$jid.'@'.htmlspecialchars($sname).'" style="cursor: pointer;" bgcolor="b5b5b5" onclick="window.location=\'trash.php\'">');
}
// content
$html->set_body('<td width="120" style="text-align: center;">'.$dat["ts"].'</td>
<td style="text-align: left;">'.$fr.'&nbsp;&nbsp;'.cut_nick($talk).'&nbsp;&nbsp;</td>
<td width="700">'.$body_talk.'</td>
<td style="text-align: center;">'.round($dat[score],2).'</td>
</tr>'
);
}
$html->set_body('<tr class="spacer" height="1px"><td colspan="5"></td></tr><tr class="foot" height="15px"><td colspan="5"></td></tr>');
}
if($a==$b) {
$html->set_body('<tr><td colspan="4" style="text-align: center;"><b>'.$no_result[$lang].'</b></td></tr>');
}
$html->set_body('</table>');
}
else {
// if user input is empty:
$html->set_body('<br><br><center><b>'.$search1[$lang].'</b></center><br><br><br><br>');
}
require_once("footer.php");
?>

View File

@ -1,330 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require_once("headers.php");
require_once("upper.php");
$tgle = $_POST['toggle'];
$vspec = $_POST['v_spec'];
// Check post data. Compare them to session info.
if ($_POST['del_all'] OR $_POST['erase_confirm']) {
debug(DEBUG,"Processing archive removal:");
if ($sess->get('validate_number') !== $_POST['validate_form']) {
debug(DEBUG," - Invalid control number, destroying POST data. Control should be: ".$sess->get('validate_number'));
unset($_POST);
$html->alert_message($oper_fail[$lang]);
}
else{
debug(DEBUG," - POST data seems to be ok.");
}
}
// Generate new control data for forms
$set_control = md5(rand(10000,10000000));
$sess->set("validate_number",$set_control);
debug(DEBUG,"Setting new control data: $set_control");
// toggle message saving
if ($tgle) {
debug(DEBUG,"Trying to change archiving option");
if ($tgle === $arch_on[$lang]) {
if($db->set_log(true) === true) {
$sess->set('log_status',true);
$db->set_logger("7","1");
$html->status_message($status_msg2[$lang]);
}
else{
$html->alert_message($oper_fail[$lang]);
}
}
elseif($tgle === $arch_off[$lang]) {
if($db->set_log(false) === true) {
$sess->set('log_status',false);
$db->set_logger("6","1");
$html->status_message($status_msg3[$lang]);
$html->system_message($status_msg1[$lang]);
}
else{
$html->alert_message($oper_fail[$lang]);
}
}
}
// Control diplaying of special contacs
if ($vspec) {
if ($db->set_jorge_pref("3",$vspec) === true) {
$html->status_message($con_saved[$lang]);
}
else{
$html->alert_message($oper_fail[$lang]);
}
}
// delete entire archive
if ($_POST['erase_confirm'] === "true") {
if ($_POST['del_all'] === $settings_del[$lang]) {
debug(DEBUG," - Trying to erase all message archives");
if ($db->erase_all() === true) {
$html->status_message($deleted_all[$lang]);
$db->set_logger("9","2");
debug(DEBUG," - DONE");
}
else{
$html->alert_message($delete_error[$lang]);
debug(DEBUG," - FAILED");
}
}
}
// set own name
if ($_POST['own_name_value']) {
// Validation is done by class, so we pass values there...
if ($db->set_own_name($_POST['own_name_value']) === true) {
$html->status_message($con_saved[$lang]);
}else{
$html->alert_message($oper_fail[$lang]);
}
}
$html->set_overview('<h2>'.$settings_desc[$lang].'</h2><small>'.$settings_desc_detail[$lang].'</small>');
$html->set_body('<center><table><form action="settings.php" method="post">
<tr style="font-size: x-small;"><td>'.$setting_d1[$lang].'</td><td><input class="settings" type="submit" name="toggle" value="');
$db->is_log_enabled();
if ($db->result->is_enabled === false) {
$html->set_body($arch_on[$lang]);
}
else {
$html->set_body($arch_off[$lang]);
}
$html->set_body('"></td></tr></form>');
$html->set_body('<form action="settings.php" method="post">
<tr style="font-size: x-small;"><td>'.$setting_d2[$lang].'</td>
<td>
<input class="settings" type="submit" name="del_all" value="'.$settings_del[$lang].'" onClick="if (!confirm(\''.$del_all_conf[$lang].'\')) return false;">
<input type="hidden" name="erase_confirm" value="true">
<input type="hidden" name="validate_form" value="'.$set_control.'">
</td>
</tr>
</form>
');
if ($db->get_jorge_pref("3") === false) {
$html->alert_message($oper_fail[$lang]);
}
$special_select = $db->result->pref_value;
if ($special_select === "2") {
$n_is_sel = "selected";
}
else{
$y_is_sel = "selected";
}
$html->set_body('
<form action="settings.php" method="post" name="tggle_special">
<tr style="font-size: x-small;"><td>'.$spec_contact_enable[$lang].'(<a href="#" title="'.$spec_contact_desc[$lang].'">?</a>)</td>
<td><select class="settings" name="v_spec" size="0" onchange="javascript:document.tggle_special.submit();">
<option '.$y_is_sel.' value="1">'.$sel_yes[$lang].'</option>
<option '.$n_is_sel.' value="2">'.$sel_no[$lang].'</optin>
</select>
</td></tr></form>
');
$html->set_body('<form action="settings.php" method="get" name="save_pref">
<tr style="font-size: x-small;"><td>'.$select_view[$lang].'</td>
<td><select class="settings" name="v" onchange="javascript:document.save_pref.submit();">
');
if ($sess->get('view_type') == "1") {
$std="selected";
}
else {
$cal="selected";
}
$html->set_body('
<option '.$std.' value="1">'.$view_standard[$lang].'</option>
<option '.$cal.' value="2">'.$view_calendar[$lang].'</optin>
</select>
<input name="set_pref" type="hidden" value="1">
<input name="ref" type="hidden" value="settings">
</td></tr>
</form>
');
$html->set_body('<form action="settings.php" method="get" name="save_pref_lang">
<tr style="font-size: x-small;"><td>'.$sel_language[$lang].'</td>
<td><select class="settings" name="lng_sw" onchange="javascript:document.save_pref_lang.submit();">
');
while (array_keys($language_support)) {
$lang_key = key($language_support);
if ($sess->get('language') === $language_support[$lang_key][0]) {
$pol_sel="selected";
}
else{
unset($pol_sel);
}
$html->set_body('<option '.$pol_sel.' value="'.$language_support[$lang_key][1].'">'.$lang_key.'</option>');
array_shift($language_support);
}
$html->set_body('
</select>
<input name="set_pref" type="hidden" value="2">
<input name="ref" type="hidden" value="settings">
</td></tr></form>
');
$html->set_body('<form action="settings.php" method="post" name="set_own_name">
<tr style="font-size: x-small;"><td>'.$own_name_enter[$lang].'(<a href="#" title="'.$own_name_desc[$lang].'">?</a>)</td>
<td>
<input name="own_name_value" class="settings" type="text" value="');
// Check if own_name is set.
$db->get_own_name();
$own_name = $db->result->own_name;
if (!$own_name) {
$html->set_body(TOKEN);
}
else{
$html->set_body(htmlspecialchars($own_name));
}
$html->set_body('" maxlength="60">
<input class="settings" type="submit" value="'.$own_name_commit[$lang].'">
</td>
</tr></form>');
$html->set_body('</table><hr size="1" noshade="noshade" style="color: #c9d7f1;"><br><small><b>'.$stats_personal_d[$lang].'</b></small>');
$db->get_personal_sum();
$total_messages = number_format($db->result->cnt);
$html->set_body('<p style="font-size: x-small;">'.$stats_personal[$lang].'<b> '.$total_messages.'</b></p><small><b>'.$stats_personal_top[$lang].'</b></small><br><br>');
$db->get_personal_top();
$results = $db->result;
if (count($results)!=0) {
$html->set_body('<table bgcolor="#ffffff" class="ff" cellspacing="0" cellpadding="3">
<tr style="background-image: url(img/bar_new.png); background-repeat:repeat-x; color: #fff; font-weight: bold;">
<td>'.$stats_personal_count[$lang].'</td><td style="text-align: center;">'.$stats_peer[$lang].'</td><td>'.$stats_when[$lang].'</td></tr>
');
foreach ($results as $result) {
$db->get_user_name($result[peer_name_id]);
$user_name = $db->result->username;
$db->get_server_name($result[peer_server_id]);
$server_name = $db->result->server_name;
$nickname=query_nick_name($ejabberd_roster,$user_name,$server_name);
$to_base = $enc->crypt_url("tslice=$result[at]&peer_name_id=$result[peer_name_id]&peer_server_id=$result[peer_server_id]");
$html->set_body('
<tr><td style="text-align: center; font-weight: bold;">'.$result[count].'</td><td><b>'.$nickname.'</b>&nbsp;
<small>('.htmlspecialchars($user_name).'@'.htmlspecialchars($server_name).')</small>
</td><td><a id="pretty" title="'.$stats_see[$lang].'" href="'.$view_type.'?a='.$to_base.'"><u>'.$result[at].'</u></a></td></tr>
');
}
$html->set_body('<tr height="15" style="background-image: url(img/bar_new.png); background-repeat:repeat-x; color: #fff;"><td colspan="3"></td></tr></table>');
}
else {
$html->set_body('<div class="message">'.$no_archives[$lang].'</div>');
}
$html->set_body('</center>');
require_once("footer.php");
?>

View File

@ -1,28 +0,0 @@
.treeview ul{ /*CSS for Simple Tree Menu*/
margin: 0;
padding: 0;
}
.treeview li{ /*Style for LI elements in general (excludes an LI that contains sub lists)*/
background: url(img/list.png) no-repeat left center;
background-color: transparent;
list-style-type: none;
padding-left: 22px;
margin-bottom: 3px;
}
.treeview li.submenu{ /* Style for LI that contains sub lists (other ULs). */
background: url(img/closed.png) no-repeat left 1px;
background-color: transparent;
cursor: hand !important;
cursor: pointer !important;
}
.treeview li.submenu ul{ /*Style for ULs that are children of LIs (submenu) */
display: none; /*Hide them by default. Don't delete. */
}
.treeview .submenu ul li{ /*Style for LIs of ULs that are children of LIs (submenu) */
cursor: default;
}

View File

@ -1,285 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require_once("headers.php");
require_once("upper.php");
if (ADMIN_NAME !== TOKEN) {
print 'no access';
exit;
}
// vhost stats
$vhost_selected = $_POST['stats_vhost'];
if (array_key_exists($vhost_selected, $vhosts) === true) {
$vhost_valid = true;
$vhost_active = $vhost_selected;
}
else{
$vhost_valid = false;
$vhost_active = null;
}
$html->set_body('<form name="stats_form" method="post"><b>'.$stats_vhost_select[$lang].' </b><select class="settings" name="stats_vhost" onchange="javascript:document.stats_form.submit();">
<option value="null">'.$vhost_select[$lang].'</option>
');
while (array_keys($vhosts)) {
$vhost = key($vhosts);
if ($_POST['stats_vhost'] == $vhost) {
$marked_vhost="selected=\"selected\"";
}
else {
unset($marked_vhost);
}
$html->set_body('<option value="'.$vhost.'" '.$marked_vhost.'>'.$vhost.'</option>');
array_shift($vhosts);
}
$html->set_body('</select></form>');
if ($vhost_valid === true) {
$db->total_messages($vhost_active);
$total_messages = $db->result;
$html->set_body('<h2><u>'.$stats_for[$lang].$vhost_active.'</u></h2><p style="padding-left: 10px;">
'.$stats_messages[$lang].' <b>'.number_format($total_messages[1][total_messages]).'</b>
'.$stats_messages_b[$lang].'<b>'.number_format($total_messages[1][total_chats]).'</b>'.$stats_messages_c[$lang].'</b></p>
<hr size="1" noshade="noshade" style="color: #cccccc;">');
// get dates
$today = date("Y-n-j");
$yesterday = date("Y-n-j", strtotime("-1 day"));
$last_week = date("Y-n-j", strtotime("-7 days"));
for ($ds=0;$ds<=4;$ds++) {
$days[$ds] = date("Y-n-j", strtotime("-$ds day"));
}
// Top 10
$html->set_body('<table class="ff" cellpadding="0" cellspacing="0" style="display:inline;">
<tr><td><b>'.$stats_top[$lang].'</b></td></tr><tr><td style="width:420px; border: 0px; vertical-align: top;">');
foreach ($days as $current_day) {
$i=0;
$html->set_body('<b>'.verbose_date($current_day,$months_names,$weekdays,true).' :</b><br>');
$db->get_top_ten($current_day,$vhost_active);
$result = $db->result;
foreach ($result as $entry) {
$i++;
$db->get_user_name($entry[owner_id],$vhost_active);
$local_user = $db->result->username;
$db->get_user_name($entry[peer_name_id],$vhost_active);
$peer_name = $db->result->username;
$db->get_server_name($entry[peer_server_id],$vhost_active);
$peer_server = $db->result->server_name;
$html->set_body('
&nbsp;<b>'.$i.'.</b> '.htmlspecialchars($local_user).'@'.$vhost_active.'<b> --> </b>
'.htmlspecialchars($peer_name).'@'.htmlspecialchars($peer_server).' (<i><b>'.$entry[count].'</b></i>)<br>
');
}
$html->set_body('<br>');
}
$html->set_body('</td></tr></table>');
// get data for graphs. We can now draw data only if we have full array. This is known issue.
$db->get_monthly_stats($vhost_active);
$result = $db->result;
if (count($result)<30) {
$html->status_message($stats_not_eno[$lang]);
}
else {
foreach ($result as $entry) {
$i++;
$f[$i] = $entry[time_unix];
$d[$i] = $entry[messages];
$e[$i] = $entry[users_total];
}
// hourly stats
$db->get_hourly_stats($yesterday,$vhost_active);
$result = $db->result;
foreach ($result as $entry) {
$hs[$entry[hour]] = $entry[value];
}
// weekly stats
$db->get_weekly_stats($last_week,$yesterday,$vhost_active);
$result = $db->result;
foreach ($result as $entry) {
$idx++;
$hy[$idx] = $entry[value];
}
$html->set_body('<table class="ff" cellpadding="0" cellspacing="0" style="display:inline;">
<tr>
<td style="padding-left: 10px vertical-align: top;">
<div id="no_users" style="width:800px;height:200px;"></div><br>
<div id="no_messages" style="width:800px;height:200px;"></div><br>
<div id="hourly_yesterday" style="width:800px;height:200px;"></div><br>
<div id="hourly_week" style="width:800px;height:200px;"></div>
</td>
</table>
<script id="source" language="javascript" type="text/javascript">
$(function () {
var d1 = [
');
$cn=31;
for ($z=1;$z<31;$z++) {
$cn--;
$html->set_body("[$f[$cn],$e[$cn]],");
}
$html->set_body('
];
var d2 = [
');
$cn=31;
for ($z=1; $z<31; $z++) {
$cn--;
$html->set_body("[$f[$cn],$d[$cn]],");
}
$html->set_body('
];
var d3 = [
');
for ($z=0;$z<24;$z++) {
$html->set_body("[$z,$hs[$z]],");
}
$html->set_body('
];
var d4 = [
');
$idx=0;
for ($z=0;$z<168;$z++) {
$idx++;
$html->set_body("[$z,$hy[$idx]],");
}
$html->set_body('
];
$.plot($("#no_users"), [{
xaxis: {
mode: "time"
},
color: "#ff0000",
label: "'.$stats_graph1[$lang].'",
data: d1,
shadowSize: 10,
lines: { show: true, fill: true },
points: { show: true, fill: true, radius: 3}
}]);
$.plot($("#no_messages"), [{
xaxis: { mode: "time" },
color: "#3480ff",
label: "'.$stats_graph2[$lang].'",
shadowSize: 10,
data: d2,
lines: { show: true, fill: true },
points: { show: true, fill: true, radius: 3}
}]);
$.plot($("#hourly_yesterday"), [{
color: "#ff0000",
label: "'.$stats_graph3[$lang].' ('.$yesterday.')", shadowSize: 10, data: d3,
bars: { show: true }
}]);
$.plot($("#hourly_week"), [{
color: "#3480ff",
label: "'.$stats_graph4[$lang].' ('.$last_week.' - '.$yesterday.')", shadowSize: 10, data: d4,
bars: { show: true }
}]);
});
</script>
');
}
}
require_once("footer.php");
?>

View File

@ -1,403 +0,0 @@
body {
background-color: #ffffff;
font-family: Arial;
font-size: 9pt;
}
h2 {
font-family: Arial;
font-size: 10pt;
}
input.cc { width: 400px; }
input:focus.cc2 { width: 400px; border: 2px solid #73a6ff; }
select.cc { width: 70pt; border: 1px solid gray; }
select.cc2 { width: 40pt; border: 1px solid gray; text-align: center; }
select.cc3 { text-align: center; }
select.settings {
text-align: center;
font-size: x-small;
width: 100pt;
}
input.settings {
text-align: center;
font-size: x-small;
width: 100pt;
}
input.log { width: 250px; border: 1px solid gray;}
input:focus.log { width: 250px; border: 1px solid #73a6ff;}
input.ccc { width: 400px; border: 1px solid gray; }
textarea.ccc { width: 400px; border: 1px solid gray; }
div.contain {
#border: 1px dashed #333;
}
div.spacer_div {
clear: both;
}
tr.header {
background-image: url(img/bar_new.png);
background-repeat:repeat-x;
color: #fff;
font-weight: bold;
}
tr.foot {
background-image: url(img/bar_new.png);
background-repeat:repeat-x;
color: #fff;
}
td.rowspace {
padding-left: 5px;
padding-right: 5px;
}
input.red {
background-color: #e0e9f7;
font-size: 12px;
color: #000000;
border:1px solid;
border-color: #ffffff;
}
input.fav {
background-color: transparent;
font-size: 8pt;
font-weight: bold;
color: #ffffff;
border:0px solid;
border-color: #ffffff;
vertical-align: bottom;
}
input.fav_main {
background-color: transparent;
font-size: 8pt;
font-weight: bold;
color: #65a5e4;
border:0px solid;
border-color: #ffffff;
vertical-align: bottom;
}
input.submit {
background-color: transparent;
font-size: 8pt;
font-weight: bold;
color: #ffffff;
border:0px solid;
border-color: #ffffff;
vertical-align: bottom;
text-decoration: underline;
}
div.message {
background-color: #fad163;
font-weight: bold;
text-align: center;
font-size: x-small;
width: 550px;
}
div.system {
background-color: #ffffff;
font-weight: bold;
text-align: center;
font-size: x-small;
width: 350px;
border-width: 1px;
border-color: #0000ff;
border-style: solid;
}
p.message {
background-color: #fad163;
font-weight: bold;
text-align: center;
font-size: x-small;
width: 400px;
}
td.message {
background-color: #fad163;
color: #fff;
font-size: x-small;
text-align: center;
}
table.ff {
font-size: 9pt;
font-family: Arial;
}
span.hlt {
background-color: yellow;
}
td.time_chat {
background-color: #669dd6;
color: #fff;
text-align: center;
}
tr.main_s {
color: black;
font-weight: bold;
font-size: 12px;
text-decoration: underline;
}
tr.maint {
font-weight: bold;
background-color: #c3d9ff;
color: #000000;
}
tr.main_row_a { background-color: #e8eef7; }
tr.main_row_b { background-color: #e0e9f7; }
tr.main_row_error { background-color: #de5b5b; }
tr.main_row_headline { background-color: #9fd8ee; }
tr.main_row_message { background-color: #ade8df; }
tr.main_row_group_to { background-color: #fdffbb; }
tr.main_row_group_from { background-color: #fdffd4; }
tr.spacer { background-color: #afccf7; }
tr.spacerb { background-color: #ffffcc; }
td.main_row_special { font-size: x-small; font-style: italic; }
tr.splitl {
background-color: #f1f7ff;
font-size: 10px;
color: grey;
text-align: center;
}
a.menue {
color: #0707cd;
}
a {
color: #000000;
text-decoration: none;
}
a.mmenu {
color: white;
text-decoration: none;
}
a:hover.mmenu {
color: white;
}
a.foot {
color: #65a5e4;
text-decoration: none;
}
a.nav_np {
color: #fff;
text-decoration: none;
font-weight: bold;
}
a:hover.nav_np {
color: #FFCC00;
font-weight: bold;
}
a.menu_chat {
color: #fff;
text-decoration: none;
}
a:hover {
color: #136ef7;
text-decoration: none;
}
td.cnter {
font-size: 7pt;
}
a.delq {
color: red;
}
a.export {
color: #4145ff;
}
a.clickl {
color: #4145ff;
text-decoration: underline;
}
input.btn{
color:#000000;
font-family:'trebuchet ms',helvetica,sans-serif;
font-size:84%;
font-weight:bold;
background-color:#e8eef7 ;
border:1px solid;
border-top-color:#696;
border-left-color:#696;
border-right-color:#363;
border-bottom-color:#363;
}
input.btn_set{
color:#fff;
font-size: x-small;
background-color:#6daae7;
border:0px solid;
border-top-color:#696;
border-left-color:#696;
border-right-color:#363;
border-bottom-color:#363;
}
input.c_map_class{
color: grey;
font-size: x-small;
text-align: center;
background-color:#fff;
border:1px solid;
}
input:focus.c_map_class {
color: grey;
font-size: x-small;
text-align: center;
background-color:#fff;
border:1px solid #73a6ff;
}
#tooltip.fancy {
background-color: #ffffcc;
border: 1px solid #afccf7;
color: #333333;
padding: 4px;
-moz-border-radius-bottomleft: 7px;
-moz-border-radius-bottomright: 7px;
-moz-border-radius-topleft: 0;
-moz-border-radius-topright: 7px;
opacity: .85;
max-width: 60em;
}
.calbck {
background-image: url(img/cal_bck.png);
background-repeat: repeat-x;
background-color: transparent;
}
.calbck_con {
background-image: url(img/cal_bck2.png);
background-repeat: repeat-x;
background-color: transparent;
}
.calhead {
font-family: Tahoma;
font-size: 10px;
font-weight: bold;
color: #FFFFFF;
}
.calweek {
font-family: Tahoma;
font-size: 10px;
color: #FFFFFF;
}
.caldays {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FFFFFF;
}
.caldaysnow {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FFFFFF;
}
.caldaysfeat {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #b9b9c1;
}
.caldayssel {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FFFFFF;
background-color: #346DA5;
}
.caldays2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FFCC00;
}
a.caldays2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FFCC00;
}
a.caldays3 {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #ffffff;
}
a.caldays4 {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #bebebe;
}
a:hover.caldays3 {
color:#FFCC00;
}
.calbckleft {
background-image: url(img/cal_bck_left2.png);
background-repeat: repeat-y;
background-color: transparent;
}
.calbckright {
background-image: url(img/cal_bck_right2.png);
background-repeat: repeat-y;
background-color: transparent;
}

View File

@ -1,55 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#
# This script generates stats for message propagation. Run it once after every midnight.
# It generates stats for _previous_ day only!
# NOTE: edit settings for your database below, This script generater stats only for configured vhost, not all of them! You need to setup separate scripts for every vhost.
#
error_reporting(E_ERROR);
print "\n[jorge] Generating stats.......";
$conn=mysql_connect("_YOUR_DATABASE_IP_", "_USERNAME_", "_PASSWORD_") or die ("DB connect failed\n");
mysql_select_db ("_DB_NAME_") or die ("DB select failed\n");
// hosts configuration:
$xmpp_host="_YOUR_XMPP_HOST_"; # Replace dot with underscore f.e.: jabber.org -> jabber_org
$vhost="_VHOST_FOR_WHICH_STATS_ARE_MADE"; # dotted form ex: jabber.org
$day_stats_a = date("Y-n-j", strtotime ("-1 day")); // if you mist stats for some day change to: date("Y-n-d", strtotime ("-1 day", strtotime("_YOUR_MISSING_DAY_"))); and generate stats manualy.
$day_stats_b = $day_stats_a;
for ($ds=0;$ds<24;$ds++) {
$de=$ds+1;
if ($de==24) {$de=0; $day_stats_b = date("Y-n-d", strtotime ("+1 day",strtotime($day_stats_a))); }
$hourly_t="select count(owner_id) from `logdb_messages_$day_stats_a"."_"."$xmpp_host` where timestamp > unix_timestamp('$day_stats_a $ds:00:00') and timestamp < unix_timestamp('$day_stats_b $de:00:00')";
$result=mysql_query($hourly_t);
$row=mysql_fetch_row($result);
$stats_insert="insert into jorge_stats (day,hour,value,vhost) values('$day_stats_a','$ds','$row[0]','$vhost')";
mysql_query($stats_insert) or die("SQL Error\n");
}
print "done\n";
?>

View File

@ -1,63 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2007 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
# This script is used for rebuilding full-text index and maintaining database performance. Run it in following conditions:
# - you changed parameters regarding full-text index
# - there were lot of deletions on tables
# - after longer period of time script was not running (it depends on your DB size)
#
# Refer to MySQL-dev documentation for info how REPAIR and OPTIMIZE statments work.
# NOTE: Edit settings below and replace all CAPSED_TEXT with proper values.
#
error_reporting(E_ERROR);
$conn=mysql_connect("_YOUR_DB_IP_ADDRESS_", "_USER_NAME_", "_PASSWORD_") or die ("DB CONNECT ERROR\n");
mysql_select_db ("_DB_NAME_") or die ("DB SELECT ERROR\n");
$query=mysql_query("show tables");
while ($result=mysql_fetch_array($query)) {
if (preg_match("/^logdb_messages_.*._REPLACE_THIS_WITH_YOUR_XMPP_HOST/i", $result[Tables_in_REPLACE_THIS_WITH_YOUR_DB_NAME])) {
$i++;
$repair="REPAIR TABLE `$result[Tables_in_REPLACE_THIS_WITH_YOUR_DB_NAME]` QUICK";
$res=mysql_query($repair);
while ($res=mysql_fetch_array($res)) {
print "Operation: $res[Op], Table: $res[Table], Status: $res[Msg_text]"."\n";
}
$optimize="OPTIMIZE TABLE `$result[Tables_in_REPLACE_THIS_WITH_YOUR_DB_NAME]`";
$res=mysql_query($optimize);
while ($res=mysql_fetch_array($res)) {
print "Operation: $res[Op], Table: $res[Table], Status: $res[Msg_text]"."\n";
}
print "--------------\n\n";
}
}
print "Finish, tables repaired: $i\n";
mysql_close();
?>

View File

@ -1,116 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
///////
///// Run this script daily, but before, set it up below
///////
////
////// NOTICE: You must set it for per-vhost basis. So for every vhost - one script. Sorry.
print date("d-m-Y H:i:s")." --> [jorge] Cleaning up trash.......";
$conn=mysql_connect("_MYSQL_HOST_", "_USER_", "_PASSWORD_") or die ("DB connect failed\n");
mysql_select_db ("_DB_NAME_") or die ("DB select failed\n");
$xmpp_host="_YOUR_XMPP_HOST_";
$query="select owner_id, peer_name_id,peer_server_id,idx,date as tslice,vhost from pending_del where timeframe < date_format((date_sub(curdate(),interval 1 month)), '%Y-%c-%e')";
$result=mysql_query($query);
if (mysql_num_rows($result)>0) {
$i=0;
while($row=mysql_fetch_array($result)) {
$i++;
$ch_del="delete from
`logdb_messages_$row[tslice]"."_$xmpp_host`
where
owner_id='$row[owner_id]'
and
peer_name_id='$row[peer_name_id]'
and
peer_server_id='$row[peer_server_id]'
and
ext = '$row[idx]'
";
$li_del="delete from
jorge_mylinks
where
owner_id='$row[owner_id]'
and
ext='$row[idx]'
and
peer_name_id = '$row[peer_name_id]'
and
peer_server_id='$row[peer_server_id]'
and
datat = '$row[tslice]'
and
vhost = '$row[vhost]'
";
$fa_del="delete from
jorge_favorites
where
owner_id='$row[owner_id]'
and
ext='$row[idx]'
and
peer_name_id = '$row[peer_name_id]'
and
peer_server_id='$row[peer_server_id]'
and
vhost = '$row[vhost]'
";
$pe_del="delete from pending_del
where owner_id='$row[owner_id]'
and
peer_name_id = '$row[peer_name_id]'
and
peer_server_id='$row[peer_server_id]'
and
date='$row[tslice]'
and
idx='$row[idx]'
and
vhost = '$row[vhost]'
";
mysql_query("$ch_del") or die("Error #1\n");
mysql_query("$li_del") or die("Error #2\n");
mysql_query("$fa_del") or dir("Error #3\n");
mysql_query("$pe_del") or die("Error #4\n");
}
print "Deleted $i chats.\n";
}
else
{
print "Nothing to delete.\n";
}
?>

View File

@ -1,167 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require_once("headers.php");
require_once("upper.php");
$html->set_overview('<h2>'.$trash_name[$lang].'</h2><small>'.$trash_desc[$lang].'</small>');
if ($enc->decrypt_url($_GET[a]) === true) {
$tslice = $enc->tslice;
$talker = $enc->peer_name_id;
$server = $enc->peer_server_id;
$action = $enc->action;
$lnk = $enc->lnk;
}
else {
$action = null;
}
if ($_GET['idx']) {
$idx = $_GET['idx'];
if ($enc->decrypt_url($idx) === true) {
if($db->set_ext_index($enc->single) !== true) {
unset($idx);
unset($action);
}
$idx = $enc->single;
}
else{
unset($idx);
unset($action);
}
}
if ($action=="undelete") {
if ($db->move_chat_from_trash($talker,$server,$tslice,$lnk,$idx) === true) {
$back_link = $enc->crypt_url("tslice=$tslice&peer_name_id=$talker&peer_server_id=$server");
$html->status_message($undo_info[$lang].'<br><a href="'.$view_type.'?a='.$back_link.'" style="color: blue;">'.$trash_vit[$lang].'</a>');
// number of items in trash
$db->get_trash_count();
$tr_n = $db->result->cnt;
}
else
{
unset($talker);
$html->alert_message($oper_fail[$lang]);
}
}
if ($action==="delete") {
if ($db->remove_messages_from_trash($talker,$server,$tslice) === true) {
$html->status_message($del_info[$lang]);
// number of items in trash
$db->get_trash_count();
$tr_n = $db->result->cnt;
}
else {
$html->alert_message($oper_fail[$lang]);
}
}
if ($tr_n < 1) {
$html->set_body('<p align="center"><b>'.$trash_empty[$lang].'</b></p>' );
}
else
{
$html->set_body('
<center>
<table id="maincontent" class="ff" align="center" border="0" cellspacing="0">
<tr class="header"><td style="padding-right: 15px;">'.$my_links_chat[$lang].'</td><td style="padding-right: 15px;">'.$logger_from_day[$lang].'</td><td>'.$del_time[$lang].'</td></tr>
<tr class="spacer"><td colspan="5"></td></tr><tbody id="searchfield">
');
$db->get_trashed_items();
$result = $db->result;
foreach ($result as $entry) {
$db->get_user_name($entry[peer_name_id]);
$talker = $db->result->username;
$db->get_server_name($entry[peer_server_id]);
$server_name = $db->result->server_name;
$tslice = $entry["date"];
$nickname = query_nick_name($ejabberd_roster,$talker,$server_name);
if (!$nickname) {
$nickname = $not_in_r[$lang];
unset($malpa);
}
else {
$malpa = "@";
}
$reconstruct_link = $enc->crypt_url("tslice=$tslice&peer_name_id=$entry[peer_name_id]&peer_server_id=$entry[peer_server_id]");
$undelete_link = $enc->crypt_url("tslice=$tslice&peer_name_id=$entry[peer_name_id]&peer_server_id=$entry[peer_server_id]&lnk=$reconstruct_link&action=undelete");
$delete_link = $enc->crypt_url("tslice=$tslice&peer_name_id=$entry[peer_name_id]&peer_server_id=$entry[peer_server_id]&lnk=$reconstruct_link&action=delete");
$idx = $enc->crypt_url("single=".$entry[idx]."");
$html->set_body('
<tr><td style="padding-left: 10px; padding-right: 10px;"><b>'.$nickname.'</b> (<i>'.htmlspecialchars($talker).$malpa.htmlspecialchars($server_name).'</i>)</td>
<td style="text-align: center;">'.$tslice.'</td>
<td style="padding-left: 5px; padding-right: 5px; font-size: x-small;">'.$entry[timeframe].'</td>
<td style="padding-left: 10px;"><a href="trash.php?a='.$undelete_link.'&amp;idx='.$idx.'">'.$trash_undel[$lang].'</a></td>
<td style="padding-left: 10px;"><a href="trash.php?a='.$delete_link.'&amp;idx='.$idx.'" onClick="if (!confirm(\''.$del_conf[$lang].'\')) return false;">'.$trash_del[$lang].'</a></td></tr>
');
}
$html->set_body('
</tbody><tr class="spacer"><td colspan="5"></td></tr><tr class="foot"><td colspan="5" height="15"></td></tr></table></center>
');
}
require_once("footer.php");
?>

View File

@ -1,490 +0,0 @@
<?
/*
Jorge - frontend for mod_logdb - ejabberd server-side message archive module.
Copyright (C) 2009 Zbigniew Zolkiewski
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
if (__FILE__==$_SERVER['SCRIPT_FILENAME']) {
header("Location: index.php?act=logout");
exit;
}
// If user have profile
if ($sess->get('log_status') === null) {
header ("Location: not_enabled.php");
exit;
}
// number of my links saved...
$db->get_mylinks_count();
$my_links_count = $db->result->cnt;
// number of items in trash
$db->get_trash_count();
$tr_n = $db->result->cnt;
// number of favorites
$db->get_favorites_count();
$favorites_count = $db->result->cnt;
// get preferences for saving
$pref_id=$_GET['set_pref'];
$pref_value=$_GET['v'];
// save preferences ONLY. Setting language in session is done in headers, here we only save that preferences.
if ($_GET['set_pref']) {
// Language selection
if ($pref_id === "2") {
//Rewrite array for late reuse
$language_change = $language_support;
// Here the $pref_value is actually $lng_sw
$pref_value = $_GET['lng_sw'];
while(array_keys($language_change)) {
$lang_key = key($language_change);
if (in_array($pref_value,$language_change[$lang_key])) {
debug(DEBUG,"Saving language preferences into database...");
if ($db->set_jorge_pref($pref_id,$pref_value) === false) {
$html->alert_message($oper_fail[$lang],"message");
debug(DEBUG,"Preferences not saved due to error");
}
else{
$html->status_message($con_saved[$lang]);
debug(DEBUG,"Preferences saved successfuly");
}
break 1;
}
array_shift($language_change);
}
}
// default view type
if ($pref_id ==="1") {
debug(DEBUG,"Saving view selection into database");
if($pref_value === "1" OR $pref_value === "2") {
if ($db->set_jorge_pref($pref_id,$pref_value) === false) {
$html->alert_message($oper_fail[$lang],"message");
debug(DEBUG,"Preferences not saved due to error");
}
else{
// Display status message only if setting via control panel
if ($_GET['ref'] === "settings") {
$html->status_message($con_saved[$lang]);
debug(DEBUG,"Preferences saved successfuly");
}
}
$sess->set('view_type',$pref_value);
}
}
}
// get preferences, if not set, fallback to standard view.
$view_type=$sess->get('view_type');
if ($view_type=="1") {
$view_type="main.php";
}
elseif($view_type=="2") {
$view_type="calendar_view.php";
}
// this is menu. not nice but works ;)
if (preg_match("/search_v2.php/i",$location))
{
$menu_main='<a class="mmenu" href="'.$view_type.'">'.$menu_item_browser[$lang].'</a>';
$menu_map='<a class="mmenu" href="chat_map.php">'.$menu_item_map[$lang].'</a>';
$menu_search='<b>'.$menu_item_search[$lang].'</b>';
$menu_mylinks='<a class="mmenu" href="my_links.php">'.$menu_item_links[$lang].' ('.$my_links_count.')</a>';
$menu_favorites='<a class="mmenu" href="favorites.php">'.$menu_item_fav[$lang].'('.$favorites_count.')</a>';
$menu_contacts='<a class="mmenu" href="contacts.php">'.$menu_item_contacts[$lang].'</a>';
$menu_logger='<a class="mmenu" href="logger.php">'.$menu_item_logs[$lang].'</a>';
$menu_trash='<a class="mmenu" href="trash.php">'.$menu_item_trash[$lang].'('.$tr_n.')</a>';
$search_loc=1;
if (TOKEN==ADMIN_NAME) { $menu_stats=' | <a class="mmenu" href="stats.php"> Stats</a>'; }
}
elseif(preg_match("/main.php/i",$location))
{
$menu_main='<b>'.$menu_item_browser[$lang].'</b>';
$menu_map='<a class="mmenu" href="chat_map.php">'.$menu_item_map[$lang].'</a>';
$menu_search='<a class="mmenu" href="search_v2.php">'.$menu_item_search[$lang].'</a>';
$menu_mylinks='<a class="mmenu" href="my_links.php">'.$menu_item_links[$lang].' ('.$my_links_count.')</a>';
$menu_favorites='<a class="mmenu" href="favorites.php">'.$menu_item_fav[$lang].'('.$favorites_count.')</a>';
$menu_contacts='<a class="mmenu" href="contacts.php">'.$menu_item_contacts[$lang].'</a>';
$menu_logger='<a class="mmenu" href="logger.php">'.$menu_item_logs[$lang].'</a>';
$menu_trash='<a class="mmenu" href="trash.php">'.$menu_item_trash[$lang].'('.$tr_n.')</a>';
if (TOKEN==ADMIN_NAME) { $menu_stats=' | <a class="mmenu" href="stats.php"> Stats</a>'; }
}
elseif(preg_match("/my_links.php/i",$location))
{
$menu_main='<a class="mmenu" href="'.$view_type.'">'.$menu_item_browser[$lang].'</a>';
$menu_map='<a class="mmenu" href="chat_map.php">'.$menu_item_map[$lang].'</a>';
$menu_search='<a class="mmenu" href="search_v2.php">'.$menu_item_search[$lang].'</a>';
$menu_mylinks='<b>'.$menu_item_links[$lang].' ('.$my_links_count.') </b>';
$menu_favorites='<a class="mmenu" href="favorites.php">'.$menu_item_fav[$lang].'('.$favorites_count.')</a>';
$menu_contacts='<a class="mmenu" href="contacts.php">'.$menu_item_contacts[$lang].'</a>';
$menu_logger='<a class="mmenu" href="logger.php">'.$menu_item_logs[$lang].'</a>';
$menu_trash='<a class="mmenu" href="trash.php">'.$menu_item_trash[$lang].'('.$tr_n.')</a>';
if (TOKEN==ADMIN_NAME) { $menu_stats=' | <a class="mmenu" href="stats.php"> Stats</a>'; }
}
elseif(preg_match("/help.php/i",$location))
{
$menu_main='<a class="mmenu" href="'.$view_type.'">'.$menu_item_browser[$lang].'</a>';
$menu_map='<a class="mmenu" href="chat_map.php">'.$menu_item_map[$lang].'</a>';
$menu_search='<a class="mmenu" href="search_v2.php">'.$menu_item_search[$lang].'</a>';
$menu_mylinks='<a class="mmenu" href="my_links.php">'.$menu_item_links[$lang].' ('.$my_links_count.')</a>';
$menu_favorites='<a class="mmenu" href="favorites.php">'.$menu_item_fav[$lang].'('.$favorites_count.')</a>';
$menu_contacts='<a class="mmenu" href="contacts.php">'.$menu_item_contacts[$lang].'</a>';
$menu_logger='<a class="mmenu" href="logger.php">'.$menu_item_logs[$lang].'</a>';
$menu_trash='<a class="mmenu" href="trash.php">'.$menu_item_trash[$lang].'('.$tr_n.')</a>';
if (TOKEN==ADMIN_NAME) { $menu_stats=' | <a class="mmenu" href="stats.php"> Stats</a>'; }
}
elseif(preg_match("/contacts.php/i", $location))
{
$menu_main='<a class="mmenu" href="'.$view_type.'">'.$menu_item_browser[$lang].'</a>';
$menu_map='<a class="mmenu" href="chat_map.php">'.$menu_item_map[$lang].'</a>';
$menu_search='<a class="mmenu" href="search_v2.php">'.$menu_item_search[$lang].'</a>';
$menu_mylinks='<a class="mmenu" href="my_links.php">'.$menu_item_links[$lang].' ('.$my_links_count.')</a>';
$menu_favorites='<a class="mmenu" href="favorites.php">'.$menu_item_fav[$lang].'('.$favorites_count.')</a>';
$menu_contacts='<b>'.$menu_item_contacts[$lang].'</b>';
$menu_logger='<a class="mmenu" href="logger.php">'.$menu_item_logs[$lang].'</a>';
$menu_trash='<a class="mmenu" href="trash.php">'.$menu_item_trash[$lang].'('.$tr_n.')</a>';
if (TOKEN==ADMIN_NAME) { $menu_stats=' | <a class="mmenu" href="stats.php">Stats</a>'; }
}
elseif(preg_match("/stats.php/i", $location))
{
$menu_main='<a class="mmenu" href="'.$view_type.'">'.$menu_item_browser[$lang].'</a>';
$menu_map='<a class="mmenu" href="chat_map.php">'.$menu_item_map[$lang].'</a>';
$menu_search='<a class="mmenu" href="search_v2.php">'.$menu_item_search[$lang].'</a>';
$menu_mylinks='<a class="mmenu" href="my_links.php">'.$menu_item_links[$lang].' ('.$my_links_count.')</a>';
$menu_favorites='<a class="mmenu" href="favorites.php">'.$menu_item_fav[$lang].'('.$favorites_count.')</a>';
$menu_contacts='<a class="mmenu" href="contacts.php">'.$menu_item_contacts[$lang].'</a>';
$menu_logger='<a class="mmenu" href="logger.php">'.$menu_item_logs[$lang].'</a>';
$menu_trash='<a class="mmenu" href="trash.php">'.$menu_item_trash[$lang].'('.$tr_n.')</a>';
if (TOKEN==ADMIN_NAME) { $menu_stats=' | <b>Stats</b></a>'; }
}
elseif(preg_match("/logger.php/i", $location))
{
$menu_main='<a class="mmenu" href="'.$view_type.'">'.$menu_item_browser[$lang].'</a>';
$menu_map='<a class="mmenu" href="chat_map.php">'.$menu_item_map[$lang].'</a>';
$menu_search='<a class="mmenu" href="search_v2.php">'.$menu_item_search[$lang].'</a>';
$menu_mylinks='<a class="mmenu" href="my_links.php">'.$menu_item_links[$lang].' ('.$my_links_count.')</a>';
$menu_favorites='<a class="mmenu" href="favorites.php">'.$menu_item_fav[$lang].'('.$favorites_count.')</a>';
$menu_contacts='<a class="mmenu" href="contacts.php">'.$menu_item_contacts[$lang].'</a>';
$menu_logger='<b>'.$menu_item_logs[$lang].'</b>';
$menu_trash='<a class="mmenu" href="trash.php">'.$menu_item_trash[$lang].'('.$tr_n.')</a>';
if (TOKEN==ADMIN_NAME) { $menu_stats=' | <a class="mmenu" href="stats.php"> Stats</a>'; }
}
elseif(preg_match("/trash.php/i", $location))
{
$menu_main='<a class="mmenu" href="'.$view_type.'">'.$menu_item_browser[$lang].'</a>';
$menu_map='<a class="mmenu" href="chat_map.php">'.$menu_item_map[$lang].'</a>';
$menu_search='<a class="mmenu" href="search_v2.php">'.$menu_item_search[$lang].'</a>';
$menu_mylinks='<a class="mmenu" href="my_links.php">'.$menu_item_links[$lang].' ('.$my_links_count.')</a>';
$menu_favorites='<a class="mmenu" href="favorites.php">'.$menu_item_fav[$lang].'('.$favorites_count.')</a>';
$menu_contacts='<a class="mmenu" href="contacts.php">'.$menu_item_contacts[$lang].'</a>';
$menu_logger='<a class="mmenu" href="logger.php">'.$menu_item_logs[$lang].'</a>';
$menu_trash='<b>'.$menu_item_trash[$lang].'('.$tr_n.')</b>';
if (TOKEN==ADMIN_NAME) { $menu_stats=' | <a class="mmenu" href="stats.php"> Stats</a>'; }
}
elseif(preg_match("/calendar_view.php/i", $location))
{
$menu_main='<b>'.$menu_item_browser[$lang].'</b>';
$menu_map='<a class="mmenu" href="chat_map.php">'.$menu_item_map[$lang].'</a>';
$menu_search='<a class="mmenu" href="search_v2.php">'.$menu_item_search[$lang].'</a>';
$menu_mylinks='<a class="mmenu" href="my_links.php">'.$menu_item_links[$lang].' ('.$my_links_count.')</a>';
$menu_favorites='<a class="mmenu" href="favorites.php">'.$menu_item_fav[$lang].'('.$favorites_count.')</a>';
$menu_contacts='<a class="mmenu" href="contacts.php">'.$menu_item_contacts[$lang].'</a>';
$menu_logger='<a class="mmenu" href="logger.php">'.$menu_item_logs[$lang].'</a>';
$menu_trash='<a class="mmenu" href="trash.php">'.$menu_item_trash[$lang].'('.$tr_n.')</a>';
if (TOKEN==ADMIN_NAME) { $menu_stats=' | <a class="mmenu" href="stats.php"> Stats</a>'; }
}
elseif(preg_match("/chat_map.php/i", $location))
{
$menu_main='<a class="mmenu" href="'.$view_type.'">'.$menu_item_browser[$lang].'</a>';
$menu_map='<b>'.$menu_item_map[$lang].'</b>';
$menu_search='<a class="mmenu" href="search_v2.php">'.$menu_item_search[$lang].'</a>';
$menu_mylinks='<a class="mmenu" href="my_links.php">'.$menu_item_links[$lang].' ('.$my_links_count.')</a>';
$menu_favorites='<a class="mmenu" href="favorites.php">'.$menu_item_fav[$lang].'('.$favorites_count.')</a>';
$menu_contacts='<a class="mmenu" href="contacts.php">'.$menu_item_contacts[$lang].'</a>';
$menu_logger='<a class="mmenu" href="logger.php">'.$menu_item_logs[$lang].'</a>';
$menu_trash='<a class="mmenu" href="trash.php">'.$menu_item_trash[$lang].'('.$tr_n.')</a>';
if (TOKEN==ADMIN_NAME) { $menu_stats=' | <a class="mmenu" href="stats.php"> Stats</a>'; }
}
elseif(preg_match("/settings.php/i", $location))
{
$menu_main='<a class="mmenu" href="'.$view_type.'">'.$menu_item_browser[$lang].'</a>';
$menu_map='<a class="mmenu" href="chat_map.php">'.$menu_item_map[$lang].'</a>';
$menu_search='<a class="mmenu" href="search_v2.php">'.$menu_item_search[$lang].'</a>';
$menu_mylinks='<a class="mmenu" href="my_links.php">'.$menu_item_links[$lang].' ('.$my_links_count.')</a>';
$menu_favorites='<a class="mmenu" href="favorites.php">'.$menu_item_fav[$lang].'('.$favorites_count.')</a>';
$menu_contacts='<a class="mmenu" href="contacts.php">'.$menu_item_contacts[$lang].'</a>';
$menu_logger='<a class="mmenu" href="logger.php">'.$menu_item_logs[$lang].'</a>';
$menu_trash='<a class="mmenu" href="trash.php">'.$menu_item_trash[$lang].'('.$tr_n.')</a>';
if (TOKEN==ADMIN_NAME) { $menu_stats=' | <a class="mmenu" href="stats.php"> Stats</a>'; }
}
elseif(preg_match("/favorites.php/i", $location))
{
$menu_main='<a class="mmenu" href="'.$view_type.'">'.$menu_item_browser[$lang].'</a>';
$menu_map='<a class="mmenu" href="chat_map.php">'.$menu_item_map[$lang].'</a>';
$menu_search='<a class="mmenu" href="search_v2.php">'.$menu_item_search[$lang].'</a>';
$menu_mylinks='<a class="mmenu" href="my_links.php">'.$menu_item_links[$lang].' ('.$my_links_count.')</a>';
$menu_favorites='<b>'.$menu_item_fav[$lang].'('.$favorites_count.')</b>';
$menu_contacts='<a class="mmenu" href="contacts.php">'.$menu_item_contacts[$lang].'</a>';
$menu_logger='<a class="mmenu" href="logger.php">'.$menu_item_logs[$lang].'</a>';
$menu_trash='<a class="mmenu" href="trash.php">'.$menu_item_trash[$lang].'('.$tr_n.')</a>';
if (TOKEN==ADMIN_NAME) { $menu_stats=' | <a class="mmenu" href="stats.php"> Stats</a>'; }
}
// check if archivization is currently enabled...
if ($sess->get('log_status') === false) {
$html->system_message($status_msg1[$lang]);
}
if ($start) {
$cur_loc="&start=$start";
}
// Show special contact?
$db->get_jorge_pref("3");
$show_spec = $db->result->pref_value;
// Display special contacts?
if ($show_spec === "2") {
$db->spec_ignore(true);
}
else {
$db->spec_ignore(false);
}
//Generate quick jump
$db->get_last_day();
$ql_date = $db->result->at;
$quick_link = $enc->crypt_url("tslice=$ql_date");
$html->menu('
<a name="top"></a>
<table border="0" cellspacing="0" class="ff" width="100%">
<tr>
<td colspan="2" height="29" style="text-align: right;">
<a href="'.$view_type.'?a='.$quick_link.'" title="'.$qlink_l[$lang].'"><span style="font-weight: bold; color: white;">&#8656;</span></a>
<b>'.TOKEN.'@'.XMPP_HOST.'</b>&nbsp; | &nbsp;
<a href="settings.php">'.$menu_item_panel[$lang].'</a>&nbsp; | &nbsp;
<a href="#" onClick="smackzk();">'.$sel_client[$lang].'</a>&nbsp; | &nbsp;
<a href="help.php" target="_blank">'.$help_but[$lang].'</a>&nbsp; | &nbsp;<a href="index.php?act=logout">'.$log_out_b[$lang].'</a><hr size="1" noshade="noshade" style="color: #c9d7f1;"></td>
</tr>
<tr><td height="57"><a href="'.$view_type.'"><img src="img/'.$brand_logo.'" alt="logo" border="0"></a></td></tr>
<tr><td valign="top" height="35"><form action="search_v2.php" method="post">
<input id="t_search" type="text" name="query" class="cc" value="'.htmlspecialchars(stripslashes($search_phase)).'">
');
if ($search_loc==1) {
if (isset($_GET[c])) {
$enc->decrypt_url($_GET['c']);
$time2_start = $enc->time_start;
$time2_end = $enc->time_end;
}
else{
$time2_start=$_POST[time2_start];
$time2_end=$_POST[time2_end];
if (validate_date($time2_start) === false) {
unset($time2_start);
}
if (validate_date($time2_start) === false) {
unset($time2_end);
}
}
if ($time2_start AND $time2_end) {
if (strtotime("$time2_start") > strtotime("$time2_end")) {
$alert = $time_range_w[$lang]; unset ($search_phase);
}
}
$db->get_uniq_chat_dates();
$result = $db->result;
foreach ($result as $row) {
$r++;
$to_tble[$r] = $row[at];
}
$html->menu('<select name="time2_start" style="text-align: center;"><option value="">'.$time_range_from[$lang].'</option>');
for ($t=1;$t<=$r;$t++) {
$html->menu('<option value="'.$to_tble[$t].'"');
if ($time2_start==$to_tble[$t]) {
$html->menu('selected="selected"');
}
$html->menu('>'.$to_tble[$t].'</option>');
}
$pass_t=$t;
$html->menu('</select>&nbsp;<select name="time2_end" style="text-align: center;"><option value="">'.$time_range_to[$lang].'</option>');
for ($t=$r;$t>=1;$t--) {
$html->menu('<option value="'.$to_tble[$t].'"');
if ($time2_end==$to_tble[$t]) {
$html->menu('selected="selected"');
}
$html->menu('>'.$to_tble[$t].'</option>');
}
$html->menu('</select>');
if ($time2_start AND !$time2_end) {
$time2_end = $to_tble[$pass_t-1];
}
if (!$time2_start AND $time2_end) {
$time2_start = $to_tble[($t+1)-$t];
}
}
$html->menu('<input type="submit" value="'.$search_box[$lang].'"></form></td>');
if ($mac_user === true) {
$html->menu('<td align="right"><a href="#"><img border="0" alt="Hello Mac user!" width="16" height="16" src="img/apple-logo.png" /></a></td>');
}
$html->menu('
</tr>
<tr style="background-image: url(img/bell-bak.png); height: 24;">
<td colspan="11" width="100%" style="text-align: left; padding-left: 30px; color: white;">
'.$menu_main.' | '
.$menu_map.' | '
.$menu_favorites.' | '
.$menu_mylinks.' | '
.$menu_search.' | '
.$menu_contacts.' | '
.$menu_logger.$menu_stats.' | '
.$menu_trash.
' | <a class="mmenu" href="#" onClick="window.location.reload()">'.$refresh[$lang].'</a>
</td>
</tr>
</table>
<p align="center"><b>'.$alert.'</b></p>
');
// Get user roster.
$rpc_roster = $ejabberd_rpc->get_roster();
// creater roster object and rewrite it to portable multidimentional array
$ejabberd_roster = new roster();
foreach ($rpc_roster as $roster_record) {
if ($roster_record[group]=="") {
$roster_record[group] = $con_no_g[$lang];
}
// avoid contacts without nick
if ($roster_record[nick]!="") {
$ejabberd_roster->add_item($roster_record[jid],$roster_record[nick],$roster_record[group]);
}
}
?>