webcalendar

Check-in [8f1b474690]

Overview
Comment: Snapshot, latest Webcalendar into git Tarball | ZIP archive | SQL archive family | descendants | master | trunk files | file ages | folders 8f1b474690a2841bf8847f71fa0a484eac9a1b1f14ac6c9bda24007bf125db6b ajv-899-334-8894@vsta.org 2017-05-29 22:43:11
Context
 2017-05-29 22:44 Get ical export working. Add option to pull all user-selected layers. (Damn it's slow, but it works.) check-in: 490daaaec6 user: ajv-899-334-8894@vsta.org tags: master, trunk 22:43 Snapshot, latest Webcalendar into git check-in: 8f1b474690 user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes

     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152  Most of the code was written by: Craig Knudsen New features and bug fixes provided by: Jukka Aittola Mike Baptiste Ralph Boßler Toby Cabot Antonio Costa Lachlan Cox Matthew Crosby Dominik Fischer Tollef Fog Heen T.R. Fullhart Ken Harris Florian Helmberger Michiel Holtkamp Jeff Hoover* Lucie Houel Peter Huetmannsberger Thomas James Ian R. Justman Thorsten Klein Ulrich Leodolter Benoit Maisonny Jonathan Mark Ed Palmer Otto Paukner Paul Reisdorf Adam Roben* David Rodrigues Adam Shantz* Andy Skunza Oliver Teuber Romuald Texier Frederic Tyndiuk Jan Willamowius Vadim Zaliva Ray Jones* Bruce Bannon* * ( Development Team ) Translations: Bulgarian: Malen Malenov Catalan: Traduït Chinese-Big5: Liang-Kuan Liu Croatian_utf8: Krunoslav Zubrinic Czech: Hanuš Adler Danish: Allan Thraen Jørgen Thomsen Jens Th Nicolaj Rasmussen Morten Nielsen Leo Todaro Dutch: Marcel van der Boom Patrick Gutlich Klaus Spithost Marieke Timmer Arnout Engelen Oliver Heesakkers Estonian: Madis Listak Finnish: Juha-Matti Åberg Jussi Siponen French: Luc Capronnier Olivier Piquerez Yves Moenner Romuald Texier Wilfrid Hubert Gérard Delafond Mario Dragone erational Ivan Machetto Emmanuel Rihn Galician: Raúl Araya Tauler German: Markus Egartner Ralph Boßler Peter Huetmannsberger Greek: Paul Gessos Hebrew: Dov Zamir Holo-Big5: Henry H. Tan-Tenn Hungarian: Gyorgy Baffia Laszlo Csecsy Istvan Bubreg Icelandic: Kristofer Arnar Einarsson Italian: Simone Cortesi Alessandro Japanese: Makoto Hamanaka Tadashi Jokagi Korean: Joonyup Jeon Norwegian: Pål Løberg/Magni Onsøien Hans Fredrik Nordhaug Polish: Lipowczan Pawel Jano Portuguese: Antonio Costa Nuno Lopes Portuguese/Brazil: Sérgio Oliveira Mauricio Piza Paulino Michelazzo José Roberto Kerne Nuno Lopes Andre Oliveira Romanian: Dan Protopopescu Russian: Andre E. Bar’yudin Ilya G. Teterev Spanish: Pedro Del Medico Pérez Rilo Eduardo Dominguez Mario Benito Swedish: Jesper Thörn Bernt Sjöström Turkish: Atilla Kazanci Welsh: Wyn James There are probably many others that I have inadvertantly missed. Thank you all for contributing to WebCalendar! 

     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545   GNU General Public License - GNU Project - Free Software Foundation (FSF)

[ Czech | English | Japanese ]

Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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 Library 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.

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 an idea of what it does. Copyright (C) yyyy  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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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 Library General Public License instead of this License.

FSF & GNU inquiries & questions to gnu@gnu.org. Other ways to contact the FSF.

Comments on these web pages to webmasters@www.gnu.org, send other questions to gnu@gnu.org.

Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA



     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433  WebCalendar NEWS File Version: $Id: NEWS,v 1.468.2.28 2013/02/22 15:56:46 cknudsen Exp$ This file lists significant changes to WebCalendar. For a more detailed list (that includes specific bugs fixed, please look at ChangeLog): http://webcalendar.cvs.sourceforge.net/*checkout*/webcalendar/webcalendar/ChangeLog?&pathrev=REL_1_2 --------------------------------------------------------------------------- Version 1.2.7 (22 Jan 2013) - Security fix: Do not show the reason for a failed login (i.e. "no such user") - Security fix: Escape HTML characters in category name. - Security fix: Check all passed in fields (either via HTML form or via URL parameter) for certain malicious tags (script, embed, etc.) and generate fatal error if found. Version 1.2.6 (07 Jan 2013) - Fix for "undefined function require_valide" bug - Other minor bug fixes. - Updated Greek translation Version 1.2.5 (29 Feb 2012) - Fixes for various security vulnerabilities include LFI (local file inclusion), XSS (cross site scripting) and others. - Updated translations: German, German-utf8, Dutch, Dutch-utf8 - Misc. minor bug fixes Version 1.2.4 (08 Aug 2011) - Fixed XSS vulnerability: malicious javascript in event descriptions submitted by public can do bad things (create admin account, delete events, etc.) when the pending event is viewed by the admin. - Fixed bug: PHP warnings on search - Removed PHP warnings - Bug fix: undefined function date_default_timezone_set in older versions of PHP. Version 1.2.3 (14 Aug 2010) - Fixed bug: could not save events with more than one category - Include backtrace in fatal errors when in development mode Version 1.2.2 (14 Aug 2010) - Fixes for PHP warnings about default timezone not being set. Version 1.2.1 (09 Apr 2010) - Addressed some published security vulnerabilities related to cross site scripting (XSS). - Fixed "500 Server Error" seen with PHP 5.2.8 and later. Some users saw either blank web page or seg fault errors with this. - Fixed mb_language error message some non-English users were seeing in 1.2.0. - A handful of minor bugfixes and patches. - Updated translations: Italian Version 1.2.0 (27 Sep 2008) - Added new 'Security Audit' page. - Moved hard-coded upcoming.php config setting to System Settings. - Added new RSS feed for Activity Log. This will allow you to be notified via RSS of event approvals/rejections, email notification, new event submissions, event updates, etc. - Removed old hack for register_globals work-around that is no longer needed. This will improve security. - Category icons can now be displayed next to events in upcoming.php - Updated Portuguese_BR translations Version 1.2.b1 (25 Feb 2008) - Changed default installation user/password to root/none - Added read/write test to db_cache /tmp folder - The following translations were updated: French, German-UTF Version 1.1.6 (19 Sep 2007) - This release fixes bugs found in 1.1.5. (For a complete list of changes, see the ChangeLog in CVS.) - Security: Fixes cross-site scripting (XSS) vulnerability in export_handler.php. Version 1.1.5 (12 Sep 2007) - Security fix: vulnerability in $includeDir in functions.php - The following translations were updated: Indonesian Version 1.1.4 (28 Aug 2007) - This release fixes bugs found in 1.1.3. Version 1.1.3 (04 Aug 2007) - New Features / Enhancements: = Import / Export / iCalendar / hCalendar / RSS + VTIMEZONE information is now captured from imported ics files and can be reused for future exports. This greatly simplifies the process and speeds up exports. = User Interface + Added option to display end times in calendars + Added CAPTCHA validation option to Public Access event creation - The following translations were updated: German Basque Version 1.1.2 (18 Dec 2006) - New Features / Enhancements: = Site Extras + Radio control are now available + Checkbox controls are now available. + Multi-Select Select controls are now available. + Site-Extra fields are now included in emails. + You can now set where each Site Extra fields show up. - All - Email - View (view_entry) - Reports - Reminders Any combination of the above is possible using bitwise operators. = User Interface + Date Range Searches have been added + Site Extra Seaches have been added + Category Filter has beed added to Advanced Search + Added Category Color option + Admin can now specify a background image for inclusion into CSS + Added new feature 'Display Long Day Names' + Added new Color Picker with many options + Added new About WebCalendar page + Reports can now contain 'fullname' + When creating Reports, you can now simply click desired value and it will auto-insert at the cursor. + The top menu is now fully configurable and custom menus can be added easily. See includes/menu/menu_config.php for details. + Added 'System Log' in menu. Added logging for adding/editing/deleting users and invalid logins. + Reorganized and grouped System Settings and user preferences - The following translations were updated: French-UTF8(new), German, Russian --------------------------------------------------------------------------- Version 1.1.1 (15 Sep 2006) - Fixes: + Fixed vulnerablity: SQL injection possible in edit_template.php, activity_log.php, admin_handler.php, pref_handler.php, export_handler.php + Fixed security: exploit allows execution of code downloaded from remote server + HUGE list of fixes (see ChangeLog for details) - New Features / Enhancements / Changes: = Permissions + User Access Control: fine grain setting of all user's permissions = Import / Export / iCalendar / hCalendar / RSS + Read/write remote ical subscriptions with new icalclient.php file. Can be enabled in user preferences in the Subscripe/Publish area. + Added Remote Calendars which allow a WebCalendar user to view external iCalendar/ics (icalshare.com, etc.) or hCalendar files from within WebCalendar. + Improved iCal parsing + Export only a specified category + Implemented VTODO support with floating display of due date per RFC2445 + Allow users to import from Outlook 2003/XP CSV file + Palm Desktop datebook import works for versions 4.1.1 and newer + Added iCal FreeBusy support + Added RSS feed if admin and user preference are enabled for it. = Performance + Style sheets no longer included in each page (faster downloads) + Added caching of db requests and parsed translations. = Event Details + Full timezone support rather than timezone offset + Improved reminder UI and added repeating functionality per RFC2445 + Can attach comments and documents to events using database BLOBs + Added support for events overlapping into next day + Added new Repeat type 'Manual' that allows adding Inclusions/Exclusions without other repeat attributes. + Implemented a new repeating event system that incorporates most requirements of RFC2445. Multiple Categories, multiple Alarms and RDATE are now supported, along with the abiity to export VTIMEZONE elements if desired. = Event Approval + Approve/confirm/reject all unapproved events + Can add a comment for reject/accept event = User Interface + Added install wizard functionality that will create or update database tables. + New JS/DHTML top menu bar added + Use drop-down selection lists for selecting time + Divided content of preferences pages into tabs + Uploadable category icons + Modified upcoming.php to display tasks (see upcoming.php for details) + Layers can be global + Allow date styles to be specified in translation file + Use FCKEditor for editing HTML event descriptions + Added new time range options for reports: next 14/30/60/90/180/365 days This allows reports to show events starting with current date + Added ability to use custom header/stylesheet/trailer on a per-user basis via user preferences. + Optional lunar phases to month view + Allow site extras in reports + Added minical.php for using in iframe in external site + Added support for multiple public calendars by enabling nonuser calendars to act as public calendar. + Added ability to change text Public Access in system settings. + Added new view that will display similar to day.php and week.php do now except for multiple users (each in their own column) = User Authentication + User authentication by IMAP + User authentication from Joomla file (user-app-joomla.php) + Added user self-registration. blacklist and email notification are optional = Email + Added support for SMTP mail using PHPMailer + Email ics attachment to external event participants + Added sending of HTML mail (for reminders only now) = Database + Added support for IBM DB2 = PHP + Do not require magic_quote PHP setting - The following translations were updated: + Czech, Danish, French, German, Greek (new), Hungarian, Norwegian, Polish, Portuguese_BR, Japanese (switched to UTF-8), Japanese-sjis (new), Japanese-eucjp, Portuguese --------------------------------------------------------------------------- Version 1.0.0 (17 May 2005) aka Buster - Fixed the following bug reports on SourceForge: 1202127: [ 1187734 ] Timezone offset problems still exist 1201821: Bypass user_sees_only_his_groups 1193835: Creator cannot edit a nonuser-event after Admin changes it. 1193579: Untimed shows up wrong in edit page 1189515: Possible to create blank usernames 1190687: users.php called as public 1190699: export.php available to public 1190704: public can access assistant_edit.php 1103215: Invalid work hours 1187734: Timezone offset problem 1120897: Conflict with exceptions 1181682: Report with no name entered -> phantom report! 1179423: private events displayed on reports 1183714: Translation error 1154432: vCal import from Mozilla fails to translate quoted-printable 1176164: iCalendar import fatally corrupts database 1181682: Reports with just spaces for a name cannot be edited 1179403: Availability selection fails when Time Format =24 1065461: timezone offset & all-day events 1107253: time zone offset 1140453: Time zone offset in email notifications 1148602: External Recipients with same name fails 1160167: 12AM Events cause display problems in edit_entry.php 1158769: Category lost when modifing event by Admin 1168686: Month display collides with minicals on Safari 1168682: RC3 Language Detection Broken for Safari. 1169403: Public Access not DEFAULT selected if Particiapants not shown. 1169078: Bad function call in import_handler.php 1168092: Overlapping events display problem 1167281: View_l loses colour for today 1167790: class=selectedday assignments in other than day.php 1162486: Path exposure issue with view_entry.php - Other bugs fixed: + Fixed problem with ical import weekly BYDAY parsing in import_ical.php + Fixed problem with missing$cat_id in week and day URLs in month.php + Fixed problem with second edit of a single event in a repeating series losing linkage with the original event. + Fixed problem with views_edit.php, select groups not returning menbers + Fixed problem with 12AM event not adding hour=0 to URL in week.php + Fixed day.php rendering problem in Safar + Applied bug fix 1151442: Overlapping events display error in week.php - New Features / Enhancements / Changes: + Split import/export back to two separate links & pages + Moved contents of scheduling tab to details tab + Updated install/index.php to improve security and display advanced php info + Added new DEFAULT webcal_config values to all sql table definition files + Removed most instances of htmlentities as unneeded + Admin no longer needs to approve Public events that they create + Added option to set LDAP_OPT_PROTOCOL_VERSION in user-ldap.php + Updated install web page to work better on Windows systems. Added display of current PHP settings. + When viewing a report, if allow_html_description is enabled but no HTML is found in an event description, use nl2br to preserve plain text formatting. - The following translations were updated: + Danish, Finnish, German, French, Japanese, Norwegian, Polish --------------------------------------------------------------------------- Version 1.0RC3 (11 Mar 2005) - Fixed the following bug reports on SourceForge: 1156729: Global-view with no valid user creates a non-translatable message 1152863: Japanese strings munged by reports.php and upcoming.php 1124461: Apostrophe in Text Aborts Translation 1154854: Nonuser cals not showing up in views 1154007: Highlight today in Year view 1088772: Nonuser calendar w/ Public as DEFAULT participant 1145390: Merge arrays with array_merge vs + in view_t.php 1151442: Overlapping events display error in day.php 1146037: Availibility legend size not dynamic and not centered in IE. 1148603: Assistants can't view Bosses Unapproved Events. 1145342: Category selection not tranferred to edit_entry page. 1118121: get_admins in user-ldap has bad search 1123508: RC3 browser language detection always returns none. 1112787: missing charset in upcoming.php - Other bugs fixed: + Fixed problem with upcoming.php header. xml:lang and lang were set to full LANGUAGE value, not abbreviation. + Fixed problem with upcoming.php with You are not Authorized error message being sent without a header. + Fixed problem with popups.php with long text strings going off screen. Maximum width is now configurable. + Fixed issue with Application Name containing ? characters in logon.php. If Application Name = Title then translate, else use Admin defined name and run through htmlspecialchars + Fixed issues with display_small_month URLs. Extra & if no $user specified. - Add meta tag for charset since MSIE requires it. + Fixed broken advanced search that would not allowing searching other users' calendars. Also added searching non-user calendars. + Added javascript that enables visibility of the start/end time or duration on the edit_entry page from availability.php + Fixed printer friendly view problem. With refresh on, the refresh URL reverted to the regular page + Fixed date_selection_html function to include values for day control + Purge events was not deleting from webcal_entry_ext_user table + Fixed issues with ODBC returning 'invalid db_type' + Fixed issue where month.php and mini-calendar today highlight based on server time - New Features / Enhancements / Changes: + Merged task files into entry files + Added 'Public Access' to Manage Calendar of: list, if Admin. + Allow user-created views to be the DEFAULT view set in user preferences. After saving or deleting an event, the user will return to this page. + Replaced popups.php code with new knoppix based code. This should eliminate the problems with popups going off screen. Popups also follow the cursor now, but can be disabled in the file. + Replaced all instances of forms[0] in javascript with the real form names. This will allow WebCalendar to co-exist with other forms on the same page. + Added patch to allow TLS with LDAP + Added patch 900968: Add outlook-style availability popup + Added global views (available to all users) + Added option to select all users for a view (rather than having to select all users in the list). If users are added later, they will be automatically included in the view. + Converted comments for use with phpDocumentor - The following translations were updated: + Dutch, Japanese (utf8, euc-jp, shift-jis), Spanish, German --------------------------------------------------------------------------- Version 1.0RC2 (09 Feb 2005) - Fixed the following bugs reports on SourceForge: 1116008: Got invalid user error when clicking on '+' icon to add new event - Other bugs fixed: + Fixed a problem with the Repeat Tab on edit_entry page, if disabled, the SAVE button was hidden as well. - New Features / Enhancements / Changes: + Modified the way settings.php file is read to handle unix/dos/mac format and also check main directory and include directory. + In day and week view, time slots with events will now use a different background color than time slots that are empty. (This restores how this worked a couple of versions ago.) + Many code changes were made to prevent the undefined variable warning that users may get if they have the PHP error_reporting setting enabled. + Documentation updated to System Administrator Guide including new instructions for setting up reminders on Windows. - The following translations were updated: + Czech --------------------------------------------------------------------------- Version 1.0RC1 (04 Feb 2005) - Fixed the following bugs reports on SourceForge: 824268: Emails notifications used wront timezone 931096: Restrict views and view edits to owner of that view 986774: Editing category as assistant was not working 1061746: layout issues with views (daily) 1066440: End Time increased by timezone offset 1085337: Categories combo-box in month.php in assistant mode 1088857: SQL bug affecting ODBC users when viewing event 1101823: Problem importing palm desktop datebook.dat file 1102167: custom header when non-admin user 1109141: Email notifications where using sender language rather than recipient language 1109323: Error in LDAP function for getting list of admins 1087604: Vanishing Layers / cookies 1086357: repeating details display 1085846: SQL error in when listing users on some databases 1085971: repeat tab does not display details 1074403: Day View is not accounting for server offset - Other bugs fixed: + Security fix: Fixed protential problem if a user attempts to login with a username that has charaters that will affect the database. + When using web-based authentication, two database connections were being opened and only one was being closed. + vCal import was completely broken + Fixed problem using htmlarea where event description would not be saved + View Event page would not display links to edit/delete under some circumstances + Fixes for WN web server + Removed duplicate trailer from edit user page (when using a custom trailer) - New Features / Enhancements: + MS SQL Server is now suppported + If php.ini setting for file_uploads is not enabled, then indicate this on the import page + Streamlined layers.php & made layers only be displayed when layers are enabled + Updated Admin docs for content & xhtml/css validity + Added new documentation in docs directory: WebCalendar-Functions.html WebCalendar-DeveloperGuide.html WebCalendar-Styling.html + Fixed various xhtml/css issues + Updated reading of settings file to better handle when file is not in exact format we are expecting. + Added database sanity check + Updated DEFAULT color scheme (Will only apply to new installs) + When html is allowed in event description, still replace newline with html break in view page and event popup if the user did not use any html. + Fixing users.php so it only shows a single user's info when the user isn't an admin + Added ability to authenticate users with postnuke user info. + Added support for automatic gradient background images for table cells - The following translations were updated: + Japanese (with support for 3 character sets) + Romanian (new) + French + German + Italian + Norwegian  Added README.html.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99   WebCalendar README WebCalendar README URL: www.k5n.us/webcalendar.php Developers: Craig Knudsen, craig@k5n.us http://www.k5n.us Jeff Hoover Adam Shantz, adamATadamshantzDOTcom, adamshantz.com Ray Jones, rjonesATumcesDOTedu Adam Roben, Bruce Bannon Documentation: System Administrator's Guide (Installation instructions, FAQ) User Manual Upgrading Instructions (Required when upgrading from an older version) License History of Changes Online Demo Developer Resources: Sourceforge.net Home WebCalendar-Functions.html WebCalendar-Database.html WebCalendar-DeveloperGuide.html Help/Troubleshooting Forum Open Discussion Forum Bug Reports Patches Latest Version Note For a complete feature list, system requirements, and installation instructions, please see the WebCalendar System Administrator's Guide. Outstanding issues • Updated translations (some are slightly out of date) Possible features for future releases • See Plans on the WebCalendar home page.  Added UPGRADING.html.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681   WebCalendar Upgrading Notes WebCalendar Upgrading Notes WebCalendar Version: 1.2.7 Document Version:$Revision: 1.43.2.15 Date: 2013/02/22 15:56:47 $Important News: A major improvement beginning with Version 1.1 is the addition of an automated installation script. This script will guide you through the installation process and help identify any problem areas that might prevent successful installation or operation of WebCalendar. • If upgrading, the script will attempt to determine your current installation version and bring your database up to date. • If this is a new installation, the installation script will create your database and setup the required tables for you. It can then create a default Administrator account and add the basic configuration data to get you up and running. This installation script was tested primarily using MySQL and Apache on a dedicated server. If using an ISP or a CPANEL installer, your mileage may vary. If problems arise, you can always follow the instruction below as in previous versions and setup your database manually. As with any upgrade, it's always a good idea to backup your data prior to installation. Another major upgrade to WebCalendar for v1.1 is the implementation of full timezone support. In previous versions, all date/time data was stored based on server time and users set their 'time offset' relative to server time. Now, all date/time data will be stored in the database as Greenwich Mean Time (GMT) and users will be able to select a timezone based on their geographical location. Having true timezone information available within WebCalendar enables the system to correct for Daylight Savings Time (DST) even if users are in different timezones. The database houses timezone information from 1970 to 2038 and can calculate the appropriate GMT offset required to allow users to see events in their true 'local time'. The installation script will perform the initial import of the timezone data and guide you through the one-time conversion required to get your existing data converted to GMT. Launch the Automatic Installation Script Upgrading Steps With the new 1.1 install wizard, you will no longer have to be troubled with uploading SQL files to phpMyAdmin or executing SQL commands yourself. Your database will be upgraded automatically from your current older WebCalendar installation. Follow the steps below to upgrade to WebCalendar 1.1 from an older version of WebCalendar. 1. Make a backup of your current WebCalendar database. This can be done a couple of different ways. • If you have access to phpMyAdmin, you can use the export function: • Startup phpMyAdmin • Select the database from the pulldown on the left under the label "Databases". (This will be the same database name used in your includes/settings.php file in your old WebCalendar install.) • Click on the "Export" tab. • It's best to use "SQL" for the format so it can be easily imported again. • Select "zipped" for compression. If you don't do this, you will just see the SQL in your browser window, and you will have to cut and paste this into a text editor to save it. • Click on the "Go" button at the bottom of the page. • If you have access to a MySQL command line (typically via shell access on a Linux server), you can use the mysqldump command: mysqldump -uUSERNAME -pPASSWORD DATABASE > dumpfile.sql Of course, replace USERNAME, PASSWORD and DATABASE from the values in your includes/settings.php file from your old WebCalendar install. 2. Make a backup of your current WebCalendar files on the server. You would typically do this with an FTP client (like FileZilla). 3. Install the new WebCalendar files in a new directory on your server. How you do this will depend on what type of access you have to your server. It is best to not overwrite your old WebCalendar install. The unpacked/unzipped files will create a directory with the current WebCalendar version name in it. 4. Optional: If you prefer to use a simple name (like "webcalendar" rather than "WebCalendar-1.1.6"), then you can rename the directory after you've installed the files. A good way to do this might be to rename your old webcalendar install to something like "webcalendar-oldinstall" and rename the new install to be the same name as your old one. Note: If you are planning on renaming the directory, it is best to do this before you proceed to the automated install. 5. Change the permissions the permissions of the includes directory. If you are doing this from FTP, change directories to the new webcalendar directory and use the following command: chmod 777 includes 6. Change the permissions the permissions of the icons directory. If you are doing this from FTP, change directories to the new webcalendar directory and use the following command: chmod 777 icons 7. Download a copy of your old includes/settings.php file from the old WebCalendar install and have it handy so you can enter the same values in your upgrade process. 8. Download all files in your old icons directory from your old WebCalendar and copy the files into the icons directory in the new install directory. 9. You're now ready to start the install/upgrade wizard. Point your browser to the web server where you have installed the files. You only need to specify the webcalendar directory to get to the wizard. Because there is no includes/settings.php file in the new install, you will be redirected to the install/upgrade wizard. 10. Once the wizard is complete, it's a good idea to change your includes permissions back to what they were originally for better security. Manual Upgrade Instructions Below are the steps needed to manually upgrade from a previous version. You can ignore everything below if you use the Automated Installation Script. Select the version of your existing install from the list below. If you are more than one version behind (i.e. the new version is v1.1.6, and you're using 0.9.39), click the "next..." link at the end of each section to move to the next version. Always follow the versions in sequence. Note: Due to large number of database types that WebCalendar can support, it would be impractical to list all the SQL variations here. All SQL listed is taken from the upgrade-mysq.sql file used during the automatic installation process. If you are using a database other then MySQL, you may want refer to the appropriate upgrade-xxxxx.sql file in the install/sql folder. My previous install was... To upgrade from v0.9 You need to create the table cal_user_pref in tables.sql. You need to create the table cal_entry_user in tables.sql that was mistakenly created as "cal_event_user" in the 0.9 release. next... To upgrade from v0.9.01 Entirely new tables are used. Use the following commands to convert your existing MySQL tables to the new tables: cd tools ./upgrade_to_0.9.7.pl mysql intranet < commands.sql where "intranet" is the name of the MySQL database that contains your WebCalendar tables. next... To upgrade from v0.9.07 - v0.9.11 To fix a bug in the handing of events at midnight, all the entries with NULL for cal_time are changed to -1. Use the following SQL command: UPDATE webcal_entry SET cal_time = -1 WHERE cal_time is null; next... To upgrade from v0.9.12 or v0.9.13 A new table was added to support repeating events. Use the following SQL command: CREATE TABLE webcal_entry_repeats ( cal_id INT DEFAULT '0' NOT NULL, cal_days CHAR(7), cal_end INT, cal_frequency INT DEFAULT '1', cal_type VARCHAR(20), PRIMARY KEY (cal_id) ); next... To upgrade from v0.9.14 - v0.9.21 A new table was added to support layering. For MySQL, the SQL is: CREATE TABLE webcal_user_layers ( cal_login varchar(25) NOT NULL, cal_layeruser varchar(25) NOT NULL, cal_color varchar(25) NULL, cal_dups CHAR(1) DEFAULT 'N', cal_layerid INT DEFAULT '0' NOT NULL, PRIMARY KEY ( cal_login, cal_layeruser ) ); next... To upgrade from v0.9.22 - v0.9.26 Two new tables were added for custom event fields and reminders. For MySQL the SQL is: CREATE TABLE webcal_site_extras ( cal_id INT DEFAULT '0' NOT NULL, cal_name VARCHAR(25) NOT NULL, cal_type INT NOT NULL, cal_date INT DEFAULT '0', cal_remind INT DEFAULT '0', cal_data TEXT, PRIMARY KEY ( cal_id, cal_name, cal_type ) ); CREATE TABLE webcal_reminder_log ( cal_id INT DEFAULT '0' NOT NULL, cal_name VARCHAR(25) NOT NULL, cal_event_date INT NOT NULL DEFAULT 0, cal_last_sent INT NOT NULL DEFAULT 0, PRIMARY KEY ( cal_id, cal_name, cal_event_date ) ); You will also need to setup the tools/send_reminders.php script to be run periodically. I would recommend once an hour. For Linux/UNIX, this is simple. Just use cron and add a line to your crontab file that looks like: 1 * * * * cd /some/directory/webcalendar/tools; ./send_reminders.php This will tell cron to run the script at one minute after the hour. Windows users will have to find another way to run the script. There are ports/look-a-likes of cron for Windows, so look around. next... To upgrade from v0.9.27 - v0.9.34 Six new tables were added for group support, views, system settings and activity logs. For MySQL the SQL is: CREATE TABLE webcal_group ( cal_group_id INT NOT NULL, cal_last_update INT NOT NULL, cal_name VARCHAR(50) NOT NULL, cal_owner VARCHAR(25) NULL, PRIMARY KEY ( cal_group_id ) ); CREATE TABLE webcal_group_user ( cal_group_id INT NOT NULL, cal_login VARCHAR(25) NOT NULL, PRIMARY KEY ( cal_group_id, cal_login ) ); CREATE TABLE webcal_view ( cal_view_id INT NOT NULL, cal_name VARCHAR(50) NOT NULL, cal_owner VARCHAR(25) NOT NULL, cal_view_type CHAR(1), PRIMARY KEY ( cal_view_id ) ); CREATE TABLE webcal_view_user ( cal_view_id INT NOT NULL, cal_login VARCHAR(25) NOT NULL, PRIMARY KEY ( cal_view_id, cal_login ) ); CREATE TABLE webcal_config ( cal_setting VARCHAR(50) NOT NULL, cal_value VARCHAR(50) NULL, PRIMARY KEY ( cal_setting ) ); CREATE TABLE webcal_entry_log ( cal_log_id INT NOT NULL, cal_date INT NOT NULL, cal_entry_id INT NOT NULL, cal_login VARCHAR(25) NOT NULL, cal_time INT NULL, cal_type CHAR(1) NOT NULL, cal_text TEXT, PRIMARY KEY ( cal_log_id ) ); next... To upgrade from v0.9.35 or v0.9.36 The webcal_entry_log table was modified, and a new table webcal_entry_repeats_not was created. Use the following SQL for MySQL: ALTER TABLE webcal_entry_log ADD cal_user_cal VARCHAR(25); CREATE TABLE webcal_entry_repeats_not ( cal_id INT NOT NULL, cal_date INT NOT NULL, PRIMARY KEY ( cal_id, cal_date ) ); next... To upgrade from v0.9.37 The webcal_entry_user table was modified, and a new table webcal_categories was created. Use the following SQL for MySQL: ALTER TABLE webcal_entry_user ADD cal_category INT DEFAULT NULL; CREATE TABLE webcal_categories ( cat_id INT NOT NULL, cat_name VARCHAR(80) NOT NULL, cat_owner VARCHAR(25), PRIMARY KEY ( cat_id ) ); next... To upgrade from v0.9.38 The names of the date settings in the database were modified. All old data settings need to be removed from the database. DELETE FROM webcal_config WHERE cal_setting LIKE 'DATE_FORMAT%'; DELETE FROM webcal_user_pref WHERE cal_setting LIKE 'DATE_FORMAT%'; next... To upgrade from v0.9.39 Two new tables were created: webcal_asst and webcal_entry_ext_user. And the column cal_ext_for_id was added to the webcal_entry table. Use the following SQL for MySQL: CREATE TABLE webcal_asst ( cal_boss VARCHAR(25) NOT NULL, cal_assistant VARCHAR(25) NOT NULL, PRIMARY KEY ( cal_boss, cal_assistant ) ); CREATE TABLE webcal_entry_ext_user ( cal_id INT DEFAULT 0 NOT NULL, cal_fullname VARCHAR(50) NOT NULL, cal_email VARCHAR(75) NULL, PRIMARY KEY ( cal_id, cal_fullname ) ); ALTER TABLE webcal_entry ADD cal_ext_for_id INT NULL; next... To upgrade from v0.9.40 One new table was added: webcal_nonuser_cals. Use the following SQL for MySQL: CREATE TABLE webcal_nonuser_cals ( cal_login VARCHAR(25) NOT NULL, cal_admin VARCHAR(25) NOT NULL, cal_firstname VARCHAR(25), cal_lastname VARCHAR(25), PRIMARY KEY ( cal_login ) ); next... To upgrade from v0.9.41 Three new tables were added: webcal_report, webcal_report_template, and webcal_import_data. Use the following SQL for MySQL: CREATE TABLE webcal_report ( cal_report_id INT NOT NULL, cal_allow_nav CHAR(1) DEFAULT 'Y', cal_cat_id INT NULL, cal_include_empty CHAR(1) DEFAULT 'N', cal_include_header CHAR(1) DEFAULT 'Y' NOT NULL, cal_is_global CHAR(1) DEFAULT 'N' NOT NULL, cal_login VARCHAR(25) NOT NULL, cal_report_name VARCHAR(50) NOT NULL, cal_report_type VARCHAR(20) NOT NULL, cal_show_in_trailer CHAR(1) DEFAULT 'N', cal_time_range INT NOT NULL, cal_update_date INT NOT NULL, cal_user VARCHAR(25) NULL, PRIMARY KEY ( cal_report_id ) ); CREATE TABLE webcal_report_template ( cal_report_id INT NOT NULL, cal_template_type CHAR(1) NOT NULL, cal_template_text TEXT, PRIMARY KEY ( cal_report_id, cal_template_type ) ); CREATE TABLE webcal_import_data ( cal_id int NOT NULL, cal_login VARCHAR(25) NOT NULL, cal_external_id VARCHAR(200) NULL, cal_import_type VARCHAR(15) NOT NULL, PRIMARY KEY ( cal_id, cal_login ) ); next... To upgrade from v0.9.42 User passwords are now stored using md5 and require the webcal_user table to be altered to accommodate larger password data. Use the following SQL for MySQL: ALTER TABLE webcal_user MODIFY cal_passwd VARCHAR(32) NULL; DROP TABLE webcal_import_data; CREATE TABLE webcal_import ( cal_import_id INT NOT NULL, cal_date INT NOT NULL, cal_login VARCHAR(25) NULL, cal_name VARCHAR(50) NULL, cal_type VARCHAR(10) NOT NULL, PRIMARY KEY ( cal_import_id ) ); CREATE TABLE webcal_import_data ( cal_id INT NOT NULL, cal_login VARCHAR(25) NOT NULL, cal_external_id VARCHAR(200) NULL, cal_import_id INT NOT NULL, cal_import_type VARCHAR(15) NOT NULL, PRIMARY KEY ( cal_id, cal_login ) ); Next, you will need to run the script found in the tools subdirectory. This will convert all your passwords from plain text to md5. You can run this from the command line (if you have a standalone version of PHP compiled): cd tools php convert_passwords.php Or, if you do not have a standalone version of PHP, you can just type in the URL to access the script in your browser: http://yourcalendarurl/tools/convert_passwords.php You may safely delete the file /tools/convert_passwords.php after successfully performing this step. Delete all webcalendar_login browser cookies. Details should be available on your local browser help section. next... To upgrade from v0.9.43 - v1.0RC2 The webcal_view table was modified. Execute the following SQL to update your database: UPDATE webcal_config SET cal_value = 'week.php' WHERE cal_setting = 'STARTVIEW'; UPDATE webcal_user_pref SET cal_value = 'day.php' WHERE cal_value = 'day' AND cal_setting = 'STARTVIEW'; UPDATE webcal_user_pref SET cal_value = 'month.php' WHERE cal_value = 'month' AND cal_setting = 'STARTVIEW'; UPDATE webcal_user_pref SET cal_value = 'week.php' WHERE cal_value = 'week' AND cal_setting = 'STARTVIEW'; UPDATE webcal_user_pref SET cal_value = 'year.php' WHERE cal_value = 'year' AND cal_setting = 'STARTVIEW'; ALTER TABLE webcal_view ADD cal_is_global CHAR(1) NOT NULL DEFAULT 'N'; UPDATE webcal_view SET cal_is_global = 'N'; next... To upgrade from v1.0RC3 - v1.0.0 Two new tables need to be created to support advanced user access control. One new table is needed to store custom user header/footer template information. Execute the following SQL to update your database: CREATE TABLE webcal_access_user ( cal_login VARCHAR(25) NOT NULL, cal_other_user VARCHAR(25) NOT NULL, cal_can_approve CHAR(1) NOT NULL DEFAULT 'N', cal_can_delete CHAR(1) NOT NULL DEFAULT 'N', cal_can_edit CHAR(1) NOT NULL DEFAULT 'N', cal_can_view CHAR(1) NOT NULL DEFAULT 'N', PRIMARY KEY ( cal_login, cal_other_user ) ); CREATE TABLE webcal_access_function ( cal_login VARCHAR(25) NOT NULL, cal_permissions VARCHAR(64) NOT NULL, PRIMARY KEY ( cal_login ) ); ALTER TABLE webcal_nonuser_cals ADD cal_is_public CHAR(1) NOT NULL DEFAULT 'N'; CREATE TABLE webcal_user_template ( cal_login VARCHAR(25) NOT NULL, cal_type CHAR(1) NOT NULL, cal_template_text TEXT, PRIMARY KEY ( cal_login, cal_type ) ); To upgrade from v1.1.0-CVS or v1.1.0a-CVS A new table is needed to support multiple categories. In addition, several new columns have been added to webcal_entry and one column added to webcal_entry_user to support VTODO tasks, and to webcal_repeats to support the much improved ical support. A new column was added to webcal_entry_repeats_not to differentiate between exclusion and inclusions. Use the following SQL to update your MySQL database: ALTER TABLE webcal_entry ADD cal_due_date int(11) default NULL; ALTER TABLE webcal_entry ADD cal_due_time int(11) default NULL; ALTER TABLE webcal_entry ADD cal_location varchar(50) default NULL; ALTER TABLE webcal_entry ADD cal_url varchar(100) default NULL; ALTER TABLE webcal_entry ADD cal_completed int(11) default NULL; ALTER TABLE webcal_entry_repeats ADD cal_endtime int(11) default NULL; ALTER TABLE webcal_entry_repeats ADD cal_byday varchar(100) default NULL; ALTER TABLE webcal_entry_repeats ADD cal_bymonth varchar(50) default NULL; ALTER TABLE webcal_entry_repeats ADD cal_bymonthday varchar(100) default NULL; ALTER TABLE webcal_entry_repeats ADD cal_bysetpos varchar(50) default NULL; ALTER TABLE webcal_entry_repeats ADD cal_byweekno varchar(50) default NULL; ALTER TABLE webcal_entry_repeats ADD cal_byyearday varchar(50) default NULL; ALTER TABLE webcal_entry_repeats ADD cal_count int(11) default NULL; ALTER TABLE webcal_entry_repeats ADD cal_wkst char(2) default 'MO'; ALTER TABLE webcal_entry_repeats_not ADD cal_exdate int(1) NOT NULL DEFAULT '1'; ALTER TABLE webcal_entry_user ADD cal_percent int(11) NOT NULL DEFAULT '0'; CREATE TABLE webcal_entry_categories ( cal_id int(11) NOT NULL default '0', cat_id int(11) NOT NULL default '0', cat_order int(11) NOT NULL default '0', cat_owner varchar(25) default NULL ); After you complete manually updating your database, you will still need to run the installation script to perform any necessary data changes needed to convert existing data.  Added about.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90  +/', '',$data ); $data = preg_replace ( "/\n\s/", ' ',$data ); $data = preg_replace ( '/\s\s+/', ' ',$data ); $data = preg_replace ( '/\n/', ' ',$data ); } print_header ( '', '', '', true, false, true ); echo '
'; if ( empty ( $credits ) ) echo ' ' . translate ( 'Title' ) . ' ' . str_replace ( 'XXX',$PROGRAM_VERSION, // translate ( 'version' ) translate ( 'version XXX' ) ) . '

' . $PROGRAM_DATE . ' ' . translate ( 'WebCalendar is a PHP application used...' ) . ' '; else { ?> ' . ' ' . print_trailer ( false, true, true ); ?>  Added access.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509   ';$saveStr = translate ( 'Save' ); $undoStr = translate ( 'Undo' );$saved = ''; // Are we handling the access form? // If so, do that, then redirect. // Handle function access first. if ( getPostValue ( 'auser' ) != '' && getPostValue ( 'submit' ) == $saveStr ) {$auser = getPostValue ( 'auser' ); $perm = ''; for ($i = 0; $i < ACCESS_NUMBER_FUNCTIONS;$i++ ) { $perm .= ( getPostValue ( 'access_' .$i ) == 'Y' ? 'Y' : 'N' ); } dbi_execute ( 'DELETE FROM webcal_access_function WHERE cal_login = ?', array ( $auser ) ); if ( ! dbi_execute ( 'INSERT INTO webcal_access_function ( cal_login, cal_permissions ) VALUES ( ?, ? )', array ($auser, $perm ) ) ) die_miserable_death ( str_replace ( 'XXX', dbi_error (),$dbErrStr ) ); $saved = true; } // Are we handling the other user form? If so, do that, then redirect. if ( getPostValue ( 'otheruser' ) != '' && getPostValue ( 'submit' ) ==$saveStr ) { $puser = getPostValue ( 'guser' );$pouser = getPostValue ( 'otheruser' ); if ( $allow_view_other ) { // Handle access to other users' calendars. // If user is not admin, // reverse values so they are granting access to their own calendar. if ( !$is_admin ) list ( $puser,$pouser ) = array ( $pouser,$puser ); dbi_execute ( 'DELETE FROM webcal_access_user WHERE cal_login = ? AND cal_other_user = ?', array ( $puser,$pouser ) ); if ( empty ( $pouser ) ) break;$approve_total = $edit_total =$view_total = 0; for ( $i = 1;$i <= 256; ) { $approve_total += getPostValue ( 'a_' .$i ); $edit_total += getPostValue ( 'e_' .$i ); $view_total += getPostValue ( 'v_' .$i ); $i +=$i; } $email = getPostValue ( 'email' );$invite = getPostValue ( 'invite' ); $time = getPostValue ( 'time' ); if ( ! dbi_execute ( 'INSERT INTO webcal_access_user ( cal_login, cal_other_user, cal_can_view, cal_can_edit, cal_can_approve, cal_can_invite, cal_can_email, cal_see_time_only ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? )', array ($puser, $pouser, ($view_total > 0 ? $view_total : 0 ), ($edit_total > 0 && $puser != '__public__' ?$edit_total : 0 ), ( $approve_total > 0 &&$puser != '__public__' ? $approve_total : 0 ), ( strlen ($invite ) ? $invite : 'N' ), ( strlen ($email ) ? $email : 'N' ), ( strlen ($time ) ? $time : 'N' ) ) ) ) { die_miserable_death ( str_replace ( 'XXX', dbi_error (),$dbErrStr ) ); } $saved = true; } }$checked = ' checked="checked"'; $guser = getPostValue ( 'guser' );$selected = ' selected="selected"'; //if ( $guser == '__default__' ) { //$otheruser = $guser; //$user_fullname = $defConfigStr; //} else$otheruser = getPostValue ( 'otheruser' ); if ( $otheruser == '__default__' ) {$otheruser_fullname = $defConfigStr;$otheruser_login = '__default__'; } elseif ( $otheruser == '__public__' ) {$otheruser_fullname = translate ( 'Public Access' ); $otheruser_login = '__public__'; } if ( ! empty ($otheruser ) ) { if ( $allow_view_other ) { user_load_variables ($otheruser, 'otheruser_' ); // Turn off admin override so we see the users own settings. $ADMIN_OVERRIDE_UAC = 'N'; // Now load all the data from webcal_access_user.$allPermissions = access_load_user_permissions ( false ); // Load default-default values if exist. if ( ! empty ( $allPermissions['__default__.__default__'] ) )$op = $allPermissions['__default__.__default__']; if ($is_admin ) { // Load user-default values if exist. if ( ! empty ( $allPermissions[$guser . '.__default__' ] ) ) $op =$allPermissions[ $guser . '.__default__' ]; // Load user-otheruser values if exist. if ( ! empty ($allPermissions[ $guser . '.' .$otheruser ] ) ) $op =$allPermissions[ $guser . '.' .$otheruser ]; } else { // Load defualt-user values if exist. if ( ! empty ( $allPermissions['__default__.' .$guser] ) ) $op =$allPermissions['__default__.' . $guser ]; // Load otheruser-user values if exist. if ( ! empty ($allPermissions[$otheruser . '.' .$guser] ) ) $op =$allPermissions[$otheruser . '.' .$guser]; } } } print_header ( '', '', ( ! empty ( $op['time'] ) &&$op['time'] == 'Y' ? 'onload="enableAll( true );"' : '' ) ); echo print_success ( $saved ); if ( ! empty ($guser ) && $is_admin ) user_load_variables ($guser, 'user_' ); ob_start (); if ( $is_admin ) {$adminStr = translate ( 'Admin' ); $userlist = get_my_users ();$nonuserlist = get_nonuser_cals (); // If we are here... we must need to print out a list of users. echo '

' . translate ( 'User Access Control' ) . ( ! empty ( $user_fullname ) ? ': ' .$user_fullname : '' ) . '

'; for ( $i = 0;$i < ACCESS_NUMBER_FUNCTIONS; $i++ ) { // Public access and NUCs can never use some of these functions.$show = true; if ( $guser == '__public__' || substr ($guser, 0, 5 ) == $NONUSER_PREFIX ) { switch ($order[$i] ) { case ACCESS_ACCESS_MANAGEMENT: case ACCESS_ACCOUNT_INFO: case ACCESS_ACTIVITY_LOG: case ACCESS_ADMIN_HOME: case ACCESS_ASSISTANTS: case ACCESS_CATEGORY_MANAGEMENT: case ACCESS_IMPORT: case ACCESS_PREFERENCES: case ACCESS_SYSTEM_SETTINGS: case ACCESS_USER_MANAGEMENT: case ACCESS_VIEW_MANAGEMENT: case ACCESS_SECURITY_AUDIT: // Skip these...$show = false; break; } } if ( $show ) echo print_checkbox ( array ( 'access_' .$order[$i], 'Y', access_get_function_description ($order[$i] ), substr ($access, $order[$i], 1 ) ), 'dito' ) . '
'; if ( ( $i + 1 ) %$div == 0 ) echo '
'; } echo '
'; $pagetitle = translate ( 'Allow Access to Other Users Calendar' ); } else { // Get list of users that this user can see (may depend on group settings) // along with all nonuser calendars. // if ($guser != '__default__' ) { $guser =$login; $pagetitle = translate ( 'Grant This User Access to My Calendar' ); } // if ($guser == '__default__' ) { // $userlist = array ( '__default__' ); //$otheruser = $otheruser_login = '__default__'; //$otheruser_fullname = $defConfigStr; // } else if ($allow_view_other ) { $userlist = get_list_of_users ($guser ); echo '

' . $pagetitle . ' ' . translate ( 'Calendar' ) . ' ' .$typeStr . ' ' . translate ( 'View Event' ) : '"25%">' . $otheruser_fullname . ' ' .$typeStr . ' ' . translate ( 'View' ) . ' ' . translate ( 'Edit' ) . ' ' . translate ( 'Approve/Reject' ) ) . '
' . translate ( 'Can Invite' ); elseif ( $j == 2 ) echo '"email"' . ( ! empty ($op['email'] ) && $op['email'] == 'N' ? '' :$checked ) . ' />' . translate ( 'Can Email' ); else { echo '"time"' . ( ! empty ( $op['time'] ) &&$op['time'] == 'Y' ? $checked : '' ) . ' onclick="enableAll( this.checked );" />' . translate ( 'Can See Time Only' );$bottomedge = 'boxbottom'; } echo ' ' . $access_type[$j] . ' ' . '
' . ( $otheruser != '__default__' &&$otheruser != '__public__' ? '   ' : '' ) . '
' . translate ( 'Public' ) . ' ' . translate ( 'Confidential' ) . ' ' . translate ( 'Private' ) . '
'; $access_type = array ( '', translate ( 'Events' ), translate ( 'Tasks' ), '', translate ( 'Journals' ) ); for ($j = 1; $j < 5;$j++ ) { $bottomedge = ''; if ($j == 3 ) continue; echo ' ' . ( $guser != '__public__' ? ' ' : '' ) . ' '; } echo ' '; } echo ' '; ob_end_flush (); ?>  Added activity_log.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71  ' // Go BACK in time. . ( ! empty ($nextpage ) ? ' ' : '' ); if ( ! empty ( $startid ) ) {$previd = $startid +$PAGE_SIZE; $res = dbi_execute ( 'SELECT MAX( cal_log_id ) FROM webcal_entry_log' ); if ($res ) { if ( $row = dbi_fetch_row ($res ) ) // Go FORWARD in time. echo '
'; dbi_free_result ( $res ); } } ob_end_flush (); echo ' ' . print_trailer (); ?>  Added add_entry.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59   0 ) { // Double check to make sure user doesn't already have the event.$is_my_event = $is_private = false;$res = dbi_execute ( 'SELECT cal_id FROM webcal_entry_user WHERE cal_login = ? AND cal_id = ?', array ( $login,$id ) ); if ( $res ) {$row = dbi_fetch_row ( $res ); if ($row[0] == $id ) {$is_my_event = true; echo str_replace ( 'XXX', $id, translate ( 'Event XXX is already on your calendar.' ) ); exit; } dbi_free_result ($res ); } // Now lets make sure the user is allowed to add the event (not private). $res = dbi_execute ( 'SELECT cal_access FROM webcal_entry WHERE cal_id = ?', array ($id ) ); if ( ! $res ) { echo str_replace ( 'XXX',$id, translate ( 'Invalid entry id XXX.' ) ); exit; } $mayNotAddStr = translate ( 'a XXX event may not be added to your calendar' );$row = dbi_fetch_row ( $res ); if ( !$is_my_event ) { if ( $row[0] == 'C' && !$is_assistant && ! $is_nonuser_admin ) { // Assistants are allowed to see confidential stuff.$is_private = true; echo str_replace ( 'XXX', translate ( 'confidential' ), $mayNotAddStr ); exit; } else if ($row[0] == 'R' ) { $is_private = true; echo str_replace ( 'XXX', translate ( 'private' ),$mayNotAddStr ); exit; } } // Add the event. if ( $readonly == 'N' && !$is_my_event && ! $is_private ) { if ( ! dbi_execute ( 'INSERT INTO webcal_entry_user ( cal_id, cal_login, cal_status ) VALUES ( ?, ?, ? )', array ($id, $login, 'A' ) ) ) // translate ( 'Error adding event' )$error = str_replace ( 'XXX', dbi_error (), translate ( 'Error adding event XXX.' ) ); } } send_to_preferred_view (); exit; ?> 

     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927   0 && $prefix == 'admin_' ) { if ($setting == 'THEME' && $value != 'none' )$my_theme = strtolower ( $value );$setting = strtoupper ( $setting );$sql = 'DELETE FROM webcal_config WHERE cal_setting = ?'; if ( ! dbi_execute ( $sql, array ($setting ) ) ) { $error = db_error ( false,$sql ); break; } if ( strlen ( $value ) > 0 ) {$sql = 'INSERT INTO webcal_config ( cal_setting, cal_value ) VALUES ( ?, ? )'; if ( ! dbi_execute ( $sql, array ($setting, $value ) ) ) {$error = db_error ( false, $sql ); break; } } } } // Reload preferences so any CSS changes will take effect. load_global_settings (); load_user_preferences (); } /* Generates HTML for color chooser options in admin pages. * * NOTE: This will be merged back into function print_color_input_html * in includes/function.php when I remove the tables from pref.php. * * @param string$varname the name of the variable to display * @param string $title color description * @param string$varval the default value to display * * @return string HTML for the color selector. */ function admin_print_color_input_html ( $varname,$title, $varval = '' ) { global$prefarray, $s,$SCRIPT; static $select;$name = ''; $setting =$varval; if ( empty ( $select ) )$select = translate ( 'Select' ) . '...'; if ( $SCRIPT == 'admin.php' ) {$name = 'admin_'; $setting =$s[$varname]; } elseif ($SCRIPT == 'pref.php' ) { $name = 'pref_';$setting = $prefarray[$varname]; } $name .=$varname; return '

'; } $currenttab = '';$error = ( $is_admin ? '' : print_not_auth (3) ); if ( ! empty ($_POST ) && empty ( $error ) ) {$currenttab = getPostValue ( 'currenttab' ); $my_theme = ''; save_pref ($_POST, 'post' ); if ( ! empty ( $my_theme ) ) { include_once 'themes/' . strtolower ($my_theme ) . '.php'; save_pref ( $webcal_theme, 'theme' ); } } // . // Load any new config settings. Existing ones will not be affected. // This function is in the install/default_config.php file. if ( function_exists ( 'db_load_config' ) && empty ($_POST ) ) db_load_config (); $menuthemes =$s = $themes = array ();$res = dbi_execute ( 'SELECT cal_setting, cal_value FROM webcal_config' ); if ( $res ) { while ($row = dbi_fetch_row ( $res ) ) {$setting = $row[0];$s[$setting] =$value = $row[1]; } dbi_free_result ($res ); } // . // Get list of theme files from /themes directory. $dir = 'themes'; if ( is_dir ($dir ) ) { if ( $dh = opendir ($dir ) ) { while ( ( $file = readdir ($dh ) ) !== false ) { if ( strpos ( $file, '_admin.php' ) ) {$themes[0][] = strtoupper ( str_replace ( '_admin.php', '', $file ) );$themes[1][] = strtoupper ( str_replace ( '.php', '', $file ) ); } else if ( strpos ($file, '_pref.php' ) ) { $themes[0][] = strtolower ( str_replace ( '_pref.php', '',$file ) ); $themes[1][] = strtolower ( str_replace ( '.php', '',$file ) ); } } sort ( $themes ); closedir ($dh ); } } // . // Get list of menu themes. $dir = 'includes/menu/themes/'; if ( is_dir ($dir ) ) { if ( $dh = opendir ($dir ) ) { while ( ( $file = readdir ($dh ) ) !== false ) { if ( $file == '.' ||$file == '..' || $file == 'CVS' ) continue; if ( is_dir ($dir . $file ) )$menuthemes[] = $file; } closedir ($dh ); } } $currenttab = getPostValue ( 'currenttab', 'settings' );$currenttab = ( ! empty ( $currenttab) ?$currenttab : 'settings' ); $BodyX = 'onload="init_admin();showTab( \'' .$currenttab . '\' );"'; print_header ( array ( 'js/admin.php', 'js/visible.php' ), '', $BodyX ); if ( !$error ) { // Make sure globals values passed to styles.php are for this user. // Makes the demo calendar and Page title accurate. $GLOBALS['APPLICATION_NAME'] =$s['APPLICATION_NAME']; $GLOBALS['BGCOLOR'] =$s['BGCOLOR']; $GLOBALS['CELLBG'] =$s['CELLBG']; $GLOBALS['FONTS'] =$s['FONTS']; $GLOBALS['H2COLOR'] =$s['H2COLOR']; $GLOBALS['HASEVENTSBG'] =$s['HASEVENTSBG']; $GLOBALS['MENU_THEME'] =$s['MENU_THEME']; $GLOBALS['MYEVENTS'] =$s['MYEVENTS']; $GLOBALS['OTHERMONTHBG'] =$s['OTHERMONTHBG']; $GLOBALS['TABLEBG'] =$s['TABLEBG']; $GLOBALS['TEXTCOLOR'] =$s['TEXTCOLOR']; $GLOBALS['THBG'] =$s['THBG']; $GLOBALS['THFG'] =$s['THFG']; $GLOBALS['TODAYCELLBG'] =$s['TODAYCELLBG']; $GLOBALS['WEEKENDBG'] =$s['WEEKENDBG']; $GLOBALS['WEEKNUMBER'] =$s['WEEKNUMBER']; define_languages (); // Load the language list. reset ( $languages );$checked = ' checked="checked"'; $selected = ' selected="selected"';$select = translate ( 'Select' ) . '...'; // . // Allow css_cache of webcal_config values. @session_start (); $_SESSION['webcal_tmp_login'] = 'blahblahblah';$editStr = ''; $choices = array ( 'day.php', 'week.php', 'month.php', 'year.php' );$choices_text = array ( translate ( 'Day' ), translate ( 'Week' ), translate ( 'Month' ), translate ( 'Year' ) ); $bottomStr = translate ( 'Bottom' );$topStr = translate ( 'Top' ); $anyoneStr = translate ( 'Anyone' );$partyStr = translate ( 'Participant' ); $saveStr = translate ( 'Save' );$option = ' '; } for ( $i = 0,$cnt = count ( $themes[0] );$i < $cnt;$i++ ) { $theme_list .=$option . $themes[1][$i] . '">' . $themes[0][$i] . ''; } for ( $i = 0,$cnt = count ( $datestyles );$i < $cnt;$i += 2 ) { $datestyle_ymd .=$option . $datestyles[$i] . '"' . ( $s['DATE_FORMAT'] ==$datestyles[$i] ?$selected : '' ) . '>' . $datestyles[$i + 1] . ''; } for ( $i = 0,$cnt = count ( $datestyles_my );$i < $cnt;$i += 2 ) { $datestyle_my .=$option . $datestyles_my[$i] . '"' . ( $s['DATE_FORMAT_MY'] ==$datestyles_my[$i] ?$selected : '' ) . '>' . $datestyles_my[$i + 1] . ''; } for ( $i = 0,$cnt = count ( $datestyles_md );$i < $cnt;$i += 2 ) { $datestyle_md .=$option . $datestyles_md[$i] . '"' . ( $s['DATE_FORMAT_MD'] ==$datestyles_md[$i] ?$selected : '' ) . '>' . $datestyles_md[$i + 1] . ''; } for ( $i = 0,$cnt = count ( $datestyles_task );$i < $cnt;$i += 2 ) { $datestyle_tk .=$option . $datestyles_task[$i] . '"' . ( $s['DATE_FORMAT_TASK'] ==$datestyles_task[$i] ?$selected : '' ) . '>' . $datestyles_task[$i + 1] . ''; } for ( $i = 0;$i < 7; $i++ ) {$start_wk_on .= $option . "$i\"" . ( $i ==$s['WEEK_START'] ? $selected : '' ) . '>' . weekday_name ($i ) . ''; $j = ($i == 0 ? 6 : $i - 1 ); // Make sure to start with Saturday.$start_wkend_on .= $option . "$j\"" . ( $j ==$s['WEEKEND_START'] ? $selected : '' ) . '>' . weekday_name ($j ) . ''; } for ( $i = 0;$i < 24; $i++ ) {$tmp = display_time ( $i * 10000, 1 );$work_hr_start .= $option . "$i\"" . ( $i ==$s['WORK_DAY_START_HOUR'] ? $selected : '' ) . '>' .$tmp . ''; $work_hr_end .=$option . "$i\"" . ($i == $s['WORK_DAY_END_HOUR'] ?$selected : '' ) . '>' . $tmp . ''; } for ($i = 0, $cnt = count ($choices ); $i <$cnt; $i++ ) {$prefer_vu .= $option .$choices[$i] . '"' . ($s['STARTVIEW'] == $choices[$i] ? $selected : '' ) . '>' .$choices_text[$i] . ''; } // Allow user to select a view also. for ($i = 0, $cnt = count ($views ); $i <$cnt; $i++ ) { if ($views[$i]['cal_is_global'] != 'Y' ) continue;$xurl = $views[$i]['url']; $xurl_strip = str_replace ( '&', '&',$xurl ); $user_vu .=$option . $xurl . '"' . ($s['STARTVIEW'] == $xurl_strip ?$selected : '' ) . '>' . $views[$i]['cal_name'] . ''; } foreach ( $menuthemes as$menutheme ) { $menu_theme_list .=$option . $menutheme . '"' . ($s['MENU_THEME'] == $menutheme ?$selected : '' ) . '>' . $menutheme . ''; } foreach ( array ( // Document color choices. 'BGCOLOR' => translate ( 'Document background' ), 'H2COLOR' => translate ( 'Document title' ), 'TEXTCOLOR' => translate ( 'Document text' ), 'MYEVENTS' => translate ( 'My event text' ), 'TABLEBG' => translate ( 'Table grid color' ), 'THBG' => translate ( 'Table header background' ), 'THFG' => translate ( 'Table header text' ), 'CELLBG' => translate ( 'Table cell background' ), 'TODAYCELLBG' => translate ( 'Table cell background for current day' ), 'HASEVENTSBG' => translate ( 'Table cell background for days with events' ), 'WEEKENDBG' => translate ( 'Table cell background for weekends' ), 'OTHERMONTHBG' => translate ( 'Table cell background for other month' ), 'WEEKNUMBER' => translate ( 'Week number color' ), 'POPUP_BG' => translate ( 'Event popup background' ), 'POPUP_FG' => translate ( 'Event popup text' ) ) as$k => $v ) {$color_sets .= admin_print_color_input_html ( $k,$v ); } set_today ( date ( 'Ymd' ) ); ob_start (); echo '

' . translate ( 'System Settings' ) . '

' . $tabs . ' ' . translate ( 'System options' ) . ' ' . ($s['APPLICATION_NAME'] == 'Title' /* translate ( 'Translated Name' ) */ ? str_replace ( 'XXX', translate ( 'Title' ), translate ( 'Translated Name (XXX)' ) ) : '' ) . '

'/* translate ( 'Your browser default language is' ) */ . str_replace ( 'XXX', translate ( get_browser_language ( true ) ), translate ( 'Your browser default language is XXX.' ) ) . '

' . print_radio ( 'ALLOW_USER_THEMES' ) . '

' . translate ( 'Site customization' ) . '

' . print_radio ( 'CUSTOM_SCRIPT' ); printf ( $editStr, 'S' ); echo ' ' . print_radio ( 'CUSTOM_HEADER' ); printf ($editStr, 'H' ); echo '

' . print_radio ( 'CUSTOM_TRAILER' ); printf ( $editStr, 'T' ); echo ' ' . print_radio ( 'ALLOW_EXTERNAL_HEADER' ) . ' ' . print_radio ( 'ALLOW_USER_HEADER' ) . ' ' . translate ( 'Date and Time' ) . '' /* Determine if we can set timezones. If not don't display any options. */ . ( set_env ( 'TZ',$s['SERVER_TIMEZONE'] ) ? '

' . print_timezone_select_html ( 'admin_', $s['SERVER_TIMEZONE'] ) . ' ' : '' ) . ' ' . print_radio ( 'GENERAL_USE_GMT' ) . ' ' .$choices_text[2] . ' ' . $choices_text[0] . ' ' .$choices_text[3] . '

' . $choices_text[2] . ' ' .$choices_text[3] . '

' . $choices_text[2] . ' ' .$choices_text[0] . '

' . translate ( 'Small Task Date' ) . '

' . print_radio ( 'TIME_FORMAT', array ( '12' => translate ( '12 hour' ), '24' => translate ( '24 hour' ) ) ) . '

' . print_radio ( 'TIMED_EVT_LEN', array ( 'D' => translate ( 'Duration' ), 'E' => translate ( 'End Time' ) ) ) . '

' . translate ( 'From' ) . ' ' . translate ( 'to' ) . '

' . translate ( 'Appearance' ) . '

' . print_radio ( 'MENU_DATE_TOP', array ( 'Y' => $topStr, 'N' =>$bottomStr ) ) . '

' . print_radio ( 'DISPLAY_SM_MONTH' ) . '

' . print_radio ( 'DISPLAY_WEEKENDS' ) . '

' . print_radio ( 'DISPLAY_LONG_DAYS' ) . '

' . print_radio ( 'DISPLAY_ALL_DAYS_IN_MONTH' ) . '

' . print_radio ( 'DISPLAY_WEEKNUMBER' ) . '

' . print_radio ( 'DISPLAY_DESC_PRINT_DAY' ) . '

' . print_radio ( 'BOLD_DAYS_IN_YEAR' ) . '

' . print_radio ( 'DISPLAY_MINUTES' ) . '

' . print_radio ( 'DISPLAY_END_TIMES' ) . '

' . print_radio ( 'DISPLAY_MOON_PHASES' ) . '

' . translate ( 'Restrictions' ) . '

' . print_radio ( 'ALLOW_VIEW_OTHER' ) . '

' . print_radio ( 'REQUIRE_APPROVALS' ) . '

' . print_radio ( 'DISPLAY_UNAPPROVED' ) . '

' /* This control is logically reversed. */ . print_radio ( 'ALLOW_CONFLICTS', array ( 'N' => translate ( 'Yes' ), 'Y' => translate ( 'No' ) ) ) . '

' . print_radio ( 'ALLOW_CONFLICT_OVERRIDE' ) . '

' . print_radio ( 'LIMIT_APPTS' ) . '

' . print_radio ( 'DISABLE_CROSSDAY_EVENTS' ) . '

' . translate ( 'Events' ) . '

' . print_radio ( 'DISABLE_LOCATION_FIELD' ) . '

' . print_radio ( 'DISABLE_URL_FIELD' ) . '

' . print_radio ( 'DISABLE_PRIORITY_FIELD' ) . '

' . print_radio ( 'DISABLE_ACCESS_FIELD' ) . '

' . print_radio ( 'DISABLE_PARTICIPANTS_FIELD' ) . '

' . print_radio ( 'DISABLE_REPEATING_FIELD' ) . '

' . print_radio ( 'ALLOW_HTML_DESCRIPTION' ) . '

' . translate ( 'Popups' ) . '

' . print_radio ( 'DISABLE_POPUPS', '', 'popup_handler' ) . '

' . print_radio ( 'SITE_EXTRAS_IN_POPUP' ) . '

' . print_radio ( 'PARTICIPANTS_IN_POPUP' ) . '

' . translate ( 'Miscellaneous' ) . '

' . print_radio ( 'PUBLIC_ACCESS', '', 'public_handler' ) . '

' . print_radio ( 'PUBLIC_ACCESS_DEFAULT_VISIBLE' ) . '

' . print_radio ( 'PUBLIC_ACCESS_DEFAULT_SELECTED' ) . '

' . print_radio ( 'PUBLIC_ACCESS_OTHERS' ) . '

' . print_radio ( 'PUBLIC_ACCESS_VIEW_PART' ) . '

' . print_radio ( 'OVERRIDE_PUBLIC' ) . '

' . print_radio ( 'UAC_ENABLED' ) . '

' . print_radio ( 'GROUPS_ENABLED' ) . '

' . print_radio ( 'USER_SEES_ONLY_HIS_GROUPS' ) . '

' . print_radio ( 'NONUSER_ENABLED' ) . '

' . print_radio ( 'NONUSER_AT_TOP', array ( 'Y' => $topStr, 'N' =>$bottomStr ) ) . '

' . translate('Upcoming Events') . ' ' . htmlspecialchars ( $SERVER_URL ) . 'upcoming.php ' . print_radio ( 'UPCOMING_EVENTS', '', '', 'N' ) . ' ' . print_radio ( 'UPCOMING_ALLOW_OVR', '', '', 'N' ) . ' ' . print_radio ( 'UPCOMING_DISPLAY_CAT_ICONS', '', '', 'Y' ) . ' ' . print_radio ( 'UPCOMING_DISPLAY_LAYERS', '', '', 'N' ) . ' ' . print_radio ( 'UPCOMING_DISPLAY_LINKS', '', '', 'Y' ) . ' ' . print_radio ( 'UPCOMING_DISPLAY_POPUPS', '', '', 'Y' ) . ' ' . print_radio ( 'REPORTS_ENABLED' ) . ' ' . print_radio ( 'PUBLISH_ENABLED' ) . ' ' /* Determine if allow_url_fopen is enabled. */ . ( preg_match ( '/(On|1|true|yes)/i', ini_get ( 'allow_url_fopen' ) ) ? ' ' . print_radio ( 'REMOTES_ENABLED' ) . ' ' : '' ) . ' ' . print_radio ( 'RSS_ENABLED' ) . ' ' . print_radio ( 'CATEGORIES_ENABLED' ) . ' ' . print_radio ( 'ENABLE_ICON_UPLOADS' ) . '' . ( ! is_dir ( 'icons/' ) /* translate ( 'Requires' ) translate ( 'folder to exist' ) */ ? str_replace ( 'XXX', 'icons', translate ( '(Requires XXX folder to exist.)' ) ) : '' ) . ' ' . print_radio ( 'DISPLAY_TASKS' ) . ' ' . print_radio ( 'DISPLAY_TASKS_IN_GRID' ) . ' ' . print_radio ( 'ALLOW_EXTERNAL_USERS', '', 'eu_handler' ) . ' ' . print_radio ( 'EXTERNAL_NOTIFICATIONS' ) . ' ' . print_radio ( 'EXTERNAL_REMINDERS' ) . ' ' . print_radio ( 'ALLOW_SELF_REGISTRATION', '', 'sr_handler' ) . ' ' . print_radio ( 'SELF_REGISTRATION_BLACKLIST' ) . ' ' . print_radio ( 'SELF_REGISTRATION_FULL' ) . ' ' . print_radio ( 'ALLOW_ATTACH', '', 'attach_handler' ) . ' Note: ' . translate ( 'Admin and owner can always add attachments if enabled.' ) . ' ' . print_checkbox ( array ( 'ALLOW_ATTACH_PART', 'Y',$partyStr ) ) . print_checkbox ( array ( 'ALLOW_ATTACH_ANY', 'Y', $anyoneStr ) ) . ' ' . print_radio ( 'ALLOW_COMMENTS', '', 'comment_handler' ) . ' Note: ' . translate ( 'Admin and owner can always add comments if enabled.' ) . ' ' . print_checkbox ( array ( 'ALLOW_COMMENTS_PART', 'Y',$partyStr ) ) . print_checkbox ( array ( 'ALLOW_COMMENTS_ANY', 'Y', $anyoneStr ) ) . ' ' . print_radio ( 'SEND_EMAIL', '', 'email_handler' ) . ' ' . print_radio ( 'SMTP_AUTH', '', 'email_handler' ) . ' ' . translate ( 'Default user settings' ) . ': ' . " \n" . ' ' . print_radio ( 'EMAIL_HTML', array ( 'Y'=> translate ( 'HTML' ), 'N'=>translate ( 'Plain Text' ) ) ) . ' ' . ' ' . print_radio ( 'EMAIL_ATTACH_ICS' ) . ' ' . ' ' . print_radio ( 'EMAIL_REMINDER' ) . ' ' . ' ' . print_radio ( 'EMAIL_EVENT_ADDED' ) . ' ' . print_radio ( 'EMAIL_EVENT_UPDATED' ) . ' ' . print_radio ( 'EMAIL_EVENT_DELETED' ) . ' ' . print_radio ( 'EMAIL_EVENT_REJECTED' ) . ' ' . print_radio ( 'EMAIL_EVENT_CREATE' ) . ' ' . translate ( 'Color options' ) . ' ' . date_to_str ( date ( 'Ymd' ),$DATE_FORMAT_MY, false ) . '

' . display_month ( date ( 'm' ), date ( 'Y' ), true ) . '

' . print_radio ( 'ALLOW_COLOR_CUSTOMIZATION' ) . '

' . ( function_exists ( 'imagepng' ) || function_exists ( 'imagegif' ) ? print_radio ( 'ENABLE_GRADIENTS' ) : translate ( 'Not available' ) ) . '

' . $color_sets . ' ' . translate ( 'Background Image options' ) . ' '; ob_end_flush (); } else // if$error echo print_error ( $error, true ); echo print_trailer (); ?>  Added adminhome.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188   table.admin, .admin td a { background:' .$CELLBG . ' } table.admin { border:1px solid #000; padding:5px } table.admin td { padding:20px } table.admin td, .admin td a { text-align:center } .admin td a { border:1px solid #EEE; border-color:#EEE #777 #777 #EEE; padding:10px } .admin td a:hover { border-color:#777 #EEE #EEE #777 background:#AAA; } ' ); $assistStr = translate ( 'Assistants' );$prefStr = translate ( 'Preferences' ); $names =$links = array (); /* Disabled for now...will move to menu when working properly if ( $is_admin && ! empty ($SERVER_URL ) && access_can_access_function ( ACCESS_SYSTEM_SETTINGS ) ) { $names[] = translate ( 'Control Panel' );$links[] = 'controlpanel.php'; } */ if ( $is_nonuser_admin ) { if ( ! access_is_enabled () || access_can_access_function ( ACCESS_PREFERENCES ) ) {$names[] = $prefStr;$links[] = 'pref.php?user=' . $user; } if ($single_user != 'Y' ) { if ( ! access_is_enabled () || access_can_access_function ( ACCESS_ASSISTANTS ) ) { $names[] =$assistStr; $links[] = 'assistant_edit.php?user=' .$user; } } } else { if ( ( $is_admin && ! access_is_enabled () ) || ( access_is_enabled () && access_can_access_function ( ACCESS_SYSTEM_SETTINGS ) ) ) {$names[] = translate ( 'System Settings' ); $links[] = 'admin.php'; } if ( ! access_is_enabled () || access_can_access_function ( ACCESS_PREFERENCES ) ) {$names[] = $prefStr;$links[] = 'pref.php'; } $names[] = ($is_admin ? translate ( 'Users' ) : translate ( 'Account' ) ); $links[] = 'users.php'; if ( access_is_enabled () && access_can_access_function ( ACCESS_ACCESS_MANAGEMENT ) ) {$names[] = translate ( 'User Access Control' ); $links[] = 'access.php'; } if ($single_user != 'Y' ) { if ( ! access_is_enabled () || access_can_access_function ( ACCESS_ASSISTANTS ) ) { $names[] =$assistStr; $links[] = 'assistant_edit.php'; } } if ($CATEGORIES_ENABLED == 'Y' ) { if ( ! access_is_enabled () || access_can_access_function ( ACCESS_CATEGORY_MANAGEMENT ) ) { $names[] = translate ( 'Categories' );$links[] = 'category.php'; } } if ( ! access_is_enabled () || access_can_access_function ( ACCESS_VIEW_MANAGEMENT ) ) { $names[] = translate ( 'Views' );$links[] = 'views.php'; } if ( ! access_is_enabled () || access_can_access_function ( ACCESS_LAYERS ) ) { $names[] = translate ( 'Layers' );$links[] = 'layers.php'; } if ( $REPORTS_ENABLED == 'Y' && ( ! access_is_enabled () || access_can_access_function ( ACCESS_REPORT ) ) ) {$names[] = translate ( 'Reports' ); $links[] = 'report.php'; } if ($is_admin ) { $names[] = translate ( 'Delete Events' );$links[] = 'purge.php'; } /* This Activity Log link shows ALL activity for ALL events, so you really need to be an admin user for this. Enabling "Activity Log" in UAC just gives you access to the log for your _own_ events or other events you have access to. */ if ( $is_admin && ( ! access_is_enabled () || access_can_access_function ( ACCESS_ACTIVITY_LOG ) ) ) {$names[] = translate ( 'Activity Log' ); $links[] = 'activity_log.php';$names[] = translate ( 'System Log' ); $links[] = 'activity_log.php?system=1'; } if ( ($is_admin || ! access_is_enabled () ) || ( access_is_enabled && access_can_access_function ( ACCESS_SECURITY_AUDIT ) ) ) { $names[] = translate ( 'Security Audit' );$links[] = 'security_audit.php'; } if ( $is_admin && ! empty ($PUBLIC_ACCESS ) && $PUBLIC_ACCESS == 'Y' ) {$names[] = translate ( 'Public Preferences' ); $links[] = 'pref.php?public=1'; } if ($is_admin && ! empty ( $PUBLIC_ACCESS ) &&$PUBLIC_ACCESS == 'Y' && $PUBLIC_ACCESS_CAN_ADD == 'Y' &&$PUBLIC_ACCESS_ADD_NEEDS_APPROVAL == 'Y' ) { $names[] = translate ( 'Unapproved Public Events' );$links[] = 'list_unapproved.php?user=__public__'; } } echo '

' . translate ( 'Administrative Tools' ) . '

'; for ( $i = 0,$cnt = count ( $names );$i < $cnt;$i++ ) { echo ( $i % COLUMNS == 0 ? ' ' . ( ! empty ($links[$i] ) ? '' : '' ) .$names[$i] . ( ! empty ($links[$i] ) ? '' : '' ) . ' ' : '' ) . ' ' . ($i % COLUMNS == COLUMNS - 1 ? ' ' : '' ); } if ( $i % COLUMNS != 0 ) { while ($i % COLUMNS != 0 ) { echo ' '; $i++; } } echo ' ' . print_trailer (); ?>  Added ajax.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79  initializeFirstPhase (); include 'includes/' .$user_inc; include 'includes/access.php'; include 'includes/validate.php'; $WebCalendar->initializeSecondPhase (); load_global_settings (); load_user_preferences ();$WebCalendar->setLanguage (); $cat_id = getValue ( 'cat_id', '-?[0-9,\-]*', true );$name = getPostValue ( 'name' ); $page = getPostValue ( 'page' ); // We're processing edit_remotes Calendar ID field. if ($page == 'edit_remotes' || $page == 'edit_nonuser' ) {$res = dbi_execute ( 'SELECT cal_login FROM webcal_nonuser_cals WHERE cal_login = ?', array ( $NONUSER_PREFIX .$name ) ); if ( $res ) {$row = dbi_fetch_row ( $res ); // Presuming we are using '_NUC_' as$NONUSER_PREFIX. if ( $name == substr ($row[0], strlen ( $NONUSER_PREFIX ) ) ) // translate ( 'Duplicate Name' ) echo str_replace ( 'XXX',$name, translate ( 'Duplicate Name XXX', true ) ); } } elseif ( $page == 'register' ||$page == 'edit_user' ) { // We're processing username field. $res = dbi_execute ( 'SELECT cal_login FROM webcal_user WHERE cal_login = ?', array ($name ) ); if ( $res ) {$row = dbi_fetch_row ( $res ); // translate ( 'Username already exists.' ) if ($row[0] == $name ) echo str_replace ( 'XXX',$name, translate ( 'Username XXX already exists.', true ) ); } } elseif ( $page == 'email' ) { // We're processing email field from any page.$res = dbi_execute ( 'SELECT cal_email FROM webcal_user WHERE cal_email = ?', array ( $name ) ); if ($res ) { $row = dbi_fetch_row ($res ); // translate ( 'Email address already exists.' ) if ( $row[0] ==$name ) echo str_replace ( 'XXX', $name, translate ( 'Email address XXX already exists.', true ) ); } } elseif ($page == 'minitask' ) { $name = ( ! empty ($name ) ? $name : 0 ); require_once 'includes/classes/Event.class'; require_once 'includes/classes/RptEvent.class'; include_once 'includes/gradient.php';$column_array = array ( 'we.cal_priority', 'we.cal_name', 'we.cal_due_date', 'weu.cal_percent' ); $task_filter = ' ORDER BY ' .$column_array[$name % 4] . ($name > 3 ? ' ASC' : ' DESC' ); echo display_small_tasks ( $cat_id ); } ?>  Added approve_entry.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154   ' . translate ( 'Additional Comments (optional)' ) . ' ' . translate ( '(Your comments will be emailed to the event creator.)' ) . ' '; exit; }$user = getValue ( 'user' ); $type = getValue ( 'type' );$id = getValue ( 'id' ); // Allow administrators to approve public events. $app_user = ($PUBLIC_ACCESS == 'Y' && ! empty ( $public ) &&$is_admin ? '__public__' : ( $is_assistant ||$is_nonuser_admin ? $user :$login ) ); // If User Access Control is enabled, we check to see if they are // allowed to approve for the specified user. if ( access_is_enabled () && ! empty ( $user ) &&$user != $login && access_user_calendar ( 'approve',$user ) ) $app_user =$user; if ( empty ( $error ) &&$id > 0 ) update_status ( 'A', $app_user,$id, $type ); if ( ! empty ($comments ) && empty ( $cancel ) ) {$mail = new WebCalMailer; // Email event creator to notify that it was approved with comments. // Get the name of the event. $res = dbi_execute ( 'SELECT cal_name, cal_description, cal_date, cal_time, cal_create_by FROM webcal_entry WHERE cal_id = ?', array ($id ) ); if ( $res ) {$row = dbi_fetch_row ( $res );$name = $row[0];$description = $row[1];$fmtdate = $row[2];$time = sprintf ( "%06d", $row[3] );$creator = $row[4]; dbi_free_result ($res ); } $eventstart = date_to_epoch ($fmtdate . $time ); // TODO figure out if creator wants approved comment email. // Check UAC.$send_user_mail = ( access_is_enabled () ? access_user_calendar ( 'email', $creator,$login ) : 'Y' ); $htmlmail = get_pref_setting ($creator, 'EMAIL_HTML' ); user_load_variables ( $creator, 'temp' );$user_TIMEZONE = get_pref_setting ( $creator, 'TIMEZONE' ); set_env ( 'TZ',$user_TIMEZONE ); $user_language = get_pref_setting ($creator, 'LANGUAGE' ); if ( $send_user_mail == 'Y' && strlen ($tempemail ) && $SEND_EMAIL != 'N' ) { reset_language ( empty ($user_language ) || ( $user_language == 'none' ) ?$LANGUAGE : $user_language ); // translate ( 'Hello' )$msg = str_replace ( 'XXX', $tempfullname, translate ( 'Hello, XXX.' ) ) // translate ( 'An appointment has been approved and comments added by' ) . "\n\n" . str_replace ( 'XXX',$login_fullname, translate ( 'XXX has approved an appointment and added comments.' ) ) . "\n\n" // translate ( 'The subject was' ) . str_replace ( 'XXX', $name, translate ( 'Subject XXX' ) ) . "\n" // translate ( 'The description is' ) . str_replace ( 'XXX',$description, translate ( 'Description XXX' ) ) . "\n" // translate ( 'Date' ) . str_replace ( 'XXX', date_to_str ( $fmtdate ), translate ( 'Date XXX' ) ) // translate ( 'Time' ) . ' ' . ( empty ($hour ) && empty ( $minute ) ? '' : str_replace ( 'XXX', // Display using user's GMT offset and display TZID. display_time ( '', 2,$eventstart, get_pref_setting ( $creator, 'TIME_FORMAT' ) ), translate ( 'Time XXX' ) ) ) . "\n"; if ( ! empty ($SERVER_URL ) ) { // DON'T change & to & here. email will handle it $url =$SERVER_URL . 'view_entry.php?id=' . $id . '&em=1'; if ($htmlmail == 'Y' ) $url = activate_urls ($url ); $msg .= "\n" .$url; } if ( ! empty ( $comments ) ) // translate ( 'Comments' )$msg .= "\n\n" . str_replace ( 'XXX', $comments, translate ( 'Comments XXX' ) );$from = ( strlen ( $login_email ) ?$login_email : $EMAIL_FALLBACK_FROM ); // Send mail.$mail->WC_Send ( $login_fullname,$tempemail, $tempfullname,$name, $msg,$htmlmail, $from ); activity_log ($id, $login,$creator, LOG_NOTIFICATION, str_replace ( 'XXX', $app_user, translate ( 'Approved w/Comments by XXX.' ) ) ); } } // Return to login TIMEZONE. set_env ( 'TZ',$TIMEZONE ); if ( empty ( $error ) && empty ($mailerError ) ) { do_redirect ( ! empty ( $ret ) &&$ret == 'listall' ? 'list_unapproved.php' : ( ( ! empty ( $ret ) &&$ret == 'list' ? 'list_unapproved.php?' : 'view_entry.php?id=' . $id . '&' ) . 'user=' .$app_user ) ); exit; } // Process errors. $mail->MailError ($mailerError, $error ); ?>  Added assistant_edit.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84  ' . ($user ? ' ' : '' ) . '

'; $assistStr = translate ( 'Assistants' ); if ($is_nonuser_admin ) { nonuser_load_variables ( $user, 'nonuser' ); echo$nonuserfullname . ' ' . $assistStr . ' -- ' . translate ( 'Admin mode' ) . ' --'; } else echo translate ( 'Your assistants' ); echo ' ' . display_admin_link () . ' ' . ($GROUPS_ENABLED == 'Y' ? ' ' : '' ) . '

'; ob_end_flush (); echo print_trailer (); ?> 

     > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25   

     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84  
'; printf ( "%s, %s %d, %d", weekday_name ( strftime ( "%w", $time ) ), month_name ($month - 1 ), $day,$year ); echo '

' . daily_matrix ( $date,$users ) . ' ' . print_trailer ( false, true, true ); ?> 

     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156  '; } else $catcolor = '#000000';$showIcon = ( ! empty ( $catIcon ) && file_exists ($catIcon ) ? 'visible' : 'hidden' ); print_header ( array ( 'js/visible.php' ) ); ob_start (); echo '

' . translate ( 'Categories' ) . '

' . display_admin_link (); $add = getGetValue ( 'add' ); if ( empty ($add ) ) $add = 0; // Adding/Editing category. if ( ( ($add == '1' ) || ( ! empty ( $id ) ) ) && empty ($error ) ) { echo '
' . $idStr . ' ' . print_color_input_html ( 'catcolor', translate ( 'Color' ),$catcolor ) . '

' . translate ( 'Upload' ) . ' ' . translate ( 'gif 3kb max' ) . ':

' : '' ) // end test of ENABLE_ICON_UPLOADS . ' ' . ( ! empty ( $id ) ? ' ' : '' ) . ' ' . ($is_admin && empty ( $id ) ? ' ' : '' ) . ' '; } else if ( empty ($error ) ) { // Displaying Categories. $global_found = false; if ( ! empty ($categories ) ) { echo '
'; foreach ( $categories as$K => $V ) { if ($K < 1 ) continue; $catIcon =$icon_path . 'cat-' . $K . '.gif';$catStr = '' . htmlentities ( $V['cat_name'] ) . ''; echo ' • ' . ($V['cat_owner'] == $login ||$is_admin ? '' . $catStr . '' :$catStr ); if ( empty ( $V['cat_owner'] ) ) { echo '*';$global_found = true; } echo ( file_exists ( $catIcon ) ? '' : '' ) . ' • '; } echo ' '; } echo ($global_found ? '

* ' . $globalStr : '' ) . ' ' . translate ( 'Make New Category' ) . ' '; } ob_end_flush (); echo ( ! empty ($error ) ? print_error ( $error ) : '' ) . print_trailer (); ?>  Added category_handler.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137  )$catname = strip_tags ( $catname );$catcolor = getValue ( 'catcolor' ); $isglobal = getValue ( 'isglobal' );$delIcon = getPostValue ( 'delIcon' ); if ( empty ( $id ) )$is_my_event = true; // New event. else { $res = dbi_execute ( 'SELECT cat_id, cat_owner FROM webcal_categories WHERE cat_id = ?', array ($id ) ); if ( $res ) {$row = dbi_fetch_row ( $res );$is_my_event = ( $row[0] ==$id && $row[1] ==$login || ( empty ( $row[1] ) &&$is_admin ) ); dbi_free_result ( $res ); } else$error = db_error (); } if ( ! empty ( $_FILES['FileName'] ) )$file = $_FILES['FileName']; // Make sure we clear$file if no file was upoaded. if ( ! empty ( $file['tmp_name'] ) &&$file['tmp_name'] == 'none' ) $file = ''; if ( !$is_my_event ) $error = print_not_auth (5);$delete = getPostValue ( 'delete' ); if ( empty ( $error ) && ! empty ($delete ) ) { // Delete this category. if ( ! dbi_execute ( 'DELETE FROM webcal_categories WHERE cat_id = ? AND ( cat_owner = ?' . ( $is_admin ? ' OR cat_owner IS NULL )' : ' )' ), array ($id, $login ) ) ) {$error = db_error (); } if ( ! dbi_execute ( 'DELETE FROM webcal_entry_categories WHERE cat_id = ? AND ( cat_owner = ?' . ( $is_admin ? ' OR cat_owner IS NULL )' : ' )' ), array ($id, $login ) ) ) {$error = db_error (); } // Rename any icons associated with this cat_id. renameIcon ( $id ); } else if ( empty ($error ) && empty ( $catname ) ) {$error = translate ( 'Category name is required' ); } else if ( empty ( $error ) ) { if ( ! empty ($id ) ) { # Update (don't let them change global status). if ( ! dbi_execute ( 'UPDATE webcal_categories SET cat_name = ?, cat_color = ? WHERE cat_id = ?', array ( $catname,$catcolor, $id ) ) )$error = db_error (); if ( ! empty ( $delIcon ) &&$delIcon == 'Y' ) renameIcon ( $id ); } else { // Add new category. // Get new id.$res = dbi_execute ( 'SELECT MAX( cat_id ) FROM webcal_categories' ); if ( $res ) {$row = dbi_fetch_row ( $res );$id = $row[0] + 1; dbi_free_result ($res ); $catowner = ($is_admin ? ( $isglobal == 'Y' ? null :$login ) : $login ); if ( ! dbi_execute ( 'INSERT INTO webcal_categories ( cat_id, cat_owner, cat_name, cat_color ) VALUES ( ?, ?, ?, ? )', array ($id, $catowner,$catname, $catcolor ) ) )$error = db_error (); } else $error = db_error (); } if ( empty ($delIcon ) && is_dir( $icon_path ) && ( ! empty ($ENABLE_ICON_UPLOADS ) && $ENABLE_ICON_UPLOADS == 'Y' ||$is_admin ) ) { // Save icon if uploaded. if ( ! empty ( $file['tmp_name'] ) ) { if ($file['type'] == 'image/gif' && $file['size'] <=$icon_max_size ) { // $icon_props = getimagesize ($file['tmp_name'] ); // print_r ($icon_props );$path_parts = pathinfo ( $_SERVER['SCRIPT_FILENAME'] );$fullIcon = $path_parts['dirname'] . '/' .$icon_path . 'cat-' . $id . '.gif'; renameIcon ($id ); $file_result = move_uploaded_file ($file['tmp_name'], $fullIcon ); // echo "Upload Result:" .$file_result; } else if ( $file['size'] >$icon_max_size ) $error = translate ( 'File size exceeds maximum.' ); else if ($file['type'] != 'image/gif' ) $error = translate ( 'File is not a gif image.' ); } // Copy icon if local file specified.$urlname = getPostvalue ( 'urlname' ); if ( ! empty ( $urlname ) && file_exists ($icon_path . $urlname ) ) copy ($icon_path . $urlname,$icon_path . 'cat-' . $id . '.gif' ); } } if ( empty ($error ) ) do_redirect ( 'category.php' ); print_header (); echo print_error ( $error ) . print_trailer (); ?>  Added catsel.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105   ' . translate ( 'Categories' ) . ' '; if ( ! empty ($categories ) ) { echo ' '; } echo '
*' . translate ( 'Global Category' ) . '
' . print_trailer ( false, true, true ); ?> 

     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120   Modified by Ray Jones for inclusion into WebCalendar. NOTE: In-line CSS styles must remain in this file for proper operation */ echo <<
{$basicStr} {$customStr}
{$currentStr} {$oldStr}
R:
G:
B:
HTML:

EOT; ?> 

     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81  initializeFirstPhase (); include 'includes/' . $user_inc;$WebCalendar->initializeSecondPhase (); load_global_settings (); $WebCalendar->setLanguage (); // Set content type for java web start header ( "Content-type: application/x-java-jnlp-file" ); // Make sure app name is set$appStr = generate_application_name (); echo ' ' . translate ( 'Control Panel' ) . ': ' . htmlentities ( $appStr ); ?> k5n.us WebCalendar Control Panel -url=' . ($use_http_auth ? ' -httpusername=' . $login . '' : ( ! empty ($login ) ? ' -user=' . $login . '' : '' ) ) ?>  Added css_cacher.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59    Added datesel.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116   0 ) {$thisyear = substr ( $date, 0, 4 );$thismonth = substr ( $date, 4, 2 ); } else {$thisyear = date ( 'Y' ); $thismonth = date ( 'm' ); }$href = 'href="datesel.php?form=' . $form . '&fday=' .$fday . '&fmonth=' . $fmonth . '&fyear=' .$fyear . '&date='; $nextdate =$href . date ( 'Ym01"', mktime ( 0, 0, 0, $thismonth + 1, 1,$thisyear ) ); $nextStr = translate ( 'Next' );$prevdate = $href . date ( 'Ym01"', mktime ( 0, 0, 0,$thismonth - 1, 1, $thisyear ));$previousStr = translate ( 'Previous' ); $monthStr = month_name ($thismonth - 1 ); $wkstart = get_weekday_before ($thisyear, $thismonth );$monthstartYmd = date ( 'Ymd', mktime ( 0, 0, 0, $thismonth, 1,$thisyear ) ); $monthendYmd = date ( 'Ymd', mktime ( 23, 59, 59,$thismonth + 1, 0, $thisyear ) ); print_header ( '','', '', true, false, true, true, true ); //build weekday names$wkdys = ''; for ( $i = 0;$i < 7; $i++ ) {$wkdys .= '
' . weekday_name ( ( $i +$WEEK_START ) % 7, 'D' ) . '
'; } //build month grid $mdays = ''; for ($i = $wkstart; date ( 'Ymd',$i ) <= $monthendYmd;$i += 604800 ) { $mdays .= ' '; for ($j = 0; $j < 7;$j++ ) { $date =$i + ( $j * 86400 ) + 43200;$dateYmd = date ( 'Ymd', $date );$mdays .= ' = $monthstartYmd &&$dateYmd <= $monthendYmd ) ||$DISPLAY_ALL_DAYS_IN_MONTH == 'Y' ? ' class="field">' . date ( 'j', $date ) . '' : '>' ) . ''; }$mdays .= ' '; } $mdays .= ' '; echo << {$wkdys} {$mdays} EOT; echo print_trailer ( false, true, true ); ?>  {$monthStr} {$thisyear} Added day.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97   ' . display_small_tasks ($cat_id ) . ' ' : '' ); $dayStr = print_day_at_a_glance ($nowYmd, ( empty ( $user ) ?$login : $user ),$can_add ); $navStr = display_navigation ( 'day' );$smallMonthStr = display_small_month ( $thismonth,$thisyear, true ); if ( empty ( $friendly ) ) {$unapprovedStr = display_unapproved_events ( $is_assistant ||$is_nonuser_admin ? $user :$login ); $printerStr = generate_printer_friendly ( 'day.php' ); }$eventinfo = ( empty ( $eventinfo ) ? '' :$eventinfo ); $trailerStr = print_trailer (); print_header ( array ( 'js/popups.php/true' ), generate_refresh_meta (), '', false, false, false, false ); echo << {$navStr}
{$smallMonthStr} {$smallTasks}
{$dayStr} {$eventinfo} {$unapprovedStr} {$printerStr} {$trailerStr} EOT; ?>  Added del_entry.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275   0 ) { // Then see who has access to edit this entry.$can_edit = ( $is_admin ||$readonly != 'Y' ); // If assistant is doing this, then we need to switch login to user in the SQL. $query_params = array ();$query_params[] = $id;$sql = 'SELECT we.cal_id, we.cal_type FROM webcal_entry we, webcal_entry_user weu WHERE we.cal_id = weu.cal_id AND we.cal_id = ? '; if ( ! $is_admin ) {$sql .= ' AND ( we.cal_create_by = ? OR weu.cal_login = ? )'; $sqlparm = ($is_assistant ? $user :$login ); $query_params[] =$sqlparm; $query_params[] =$sqlparm; } $res = dbi_execute ($sql, $query_params ); if ($res ) { $row = dbi_fetch_row ($res ); if ( $row &&$row[0] > 0 ) $can_edit = true;$activity_type = $row[1]; dbi_free_result ($res ); } } if ( strpos ( 'EM', $activity_type ) !== false ) {$log_delete = LOG_DELETE; $log_reject = LOG_REJECT; } else {$log_delete = LOG_DELETE_T; $log_reject = LOG_REJECT_T; } // See who owns the event. Owner should be able to delete.$res = dbi_execute ( 'SELECT cal_create_by FROM webcal_entry WHERE cal_id = ?', array ( $id ) ); if ($res ) { $row = dbi_fetch_row ($res ); $owner =$row[0]; dbi_free_result ( $res ); if ($owner == $login ||$is_assistant && $user ==$owner || $is_nonuser_admin )$can_edit = $my_event = true; // Check UAC. if ( access_is_enabled () && !$is_admin ) $can_edit = access_user_calendar ( 'edit',$owner ); } // If the user is the event creator or their assistant // allow them to delete the event from another user's calendar. // It's essentially the same thing as editing the event and removing the // user from the participants list. if ( $my_event && ! empty ($user ) && $user !=$login && ! $is_assistant )$other_user = $user; if ($readonly == 'Y' ) $can_edit = false; // If User Access Control is enabled, check to see if the current // user is allowed to delete events from the other user's calendar. if ( !$can_edit && access_is_enabled () && ! empty ( $user ) && access_user_calendar ( 'edit',$user ) ) $can_edit = true; if ( !$can_edit ) $error = print_not_auth (6); // Is this a repeating event?$event_repeats = false; $res = dbi_execute ( 'SELECT COUNT( cal_id ) FROM webcal_entry_repeats WHERE cal_id = ?', array ($id ) ); if ( $res ) {$row = dbi_fetch_row ( $res ); if ($row[0] > 0 ) $event_repeats = true; dbi_free_result ($res ); } $override_repeat = false; if ( ! empty ($date ) && $event_repeats && ! empty ($override ) ) $override_repeat = true; if ($id > 0 && empty ( $error ) ) { if ( ! empty ($date ) ) $thisdate =$date; else { $res = dbi_execute ( 'SELECT cal_date FROM webcal_entry WHERE cal_id = ?', array ($id ) ); if ( $res ) { // date format is 19991231$row = dbi_fetch_row ( $res );$thisdate = $row[0]; } } // Only allow delete of webcal_entry & webcal_entry_repeats // if owner or admin, not participant. // If a user was specified, then only delete that user (not here) even if we // are the owner or an admin. if ( ($is_admin || $my_event ) && !$other_user ) { // Email participants that the event was deleted. // First, get list of participants (with status Approved or Waiting on approval). $res = dbi_execute ( 'SELECT cal_login FROM webcal_entry_user WHERE cal_id = ? AND cal_status IN ( \'A\', \'W\' )', array ($id ) ); $partlogin = array (); if ($res ) { while ( $row = dbi_fetch_row ($res ) ) { $partlogin[] =$row[0]; } dbi_free_result ( $res ); } // Get event name.$res = dbi_execute ( 'SELECT cal_name, cal_date, cal_time FROM webcal_entry WHERE cal_id = ?', array ( $id ) ); if ($res ) { $row = dbi_fetch_row ($res ); $name =$row[0]; $fmtdate =$row[1]; $time = sprintf ( "%06d",$row[2] ); dbi_free_result ( $res ); }$eventstart = date_to_epoch ( $fmtdate .$time ); $TIME_FORMAT = 24; for ($i = 0, $cnt = count ($partlogin ); $i <$cnt; $i++ ) { // Log the deletion. activity_log ($id, $login,$partlogin[$i],$log_delete, '' ); // Check UAC. $can_email = ( access_is_enabled () ? access_user_calendar ( 'email',$partlogin[$i],$login ) : false ); // Don't email the logged in user. if ( $can_email &&$partlogin[$i] !=$login ) { set_env ( 'TZ', get_pref_setting ( $partlogin[$i], 'TIMEZONE' ) ); $user_language = get_pref_setting ($partlogin[$i], 'LANGUAGE' ); user_load_variables ($partlogin[$i], 'temp' ); if ( !$is_nonuser_admin && $partlogin[$i] != $login && get_pref_setting ($partlogin[$i], 'EMAIL_EVENT_DELETED' ) == 'Y' && boss_must_be_notified ($login, $partlogin[$i] ) && ! empty ( $tempemail ) &&$SEND_EMAIL != 'N' ) { reset_language ( empty ( $user_language ) ||$user_language == 'none' ? $LANGUAGE :$user_language ); // Use WebCalMailer class. $mail->WC_Send ($login_fullname, $tempemail,$tempfullname, $name, str_replace ( 'XXX',$tempfullname, translate ( 'Hello, XXX.' ) ) . ".\n\n" . str_replace ( 'XXX', $login_fullname, // translate ( 'An appointment has been canceled for you by' ) translate ( 'XXX has canceled an appointment.' ) ) . "\n" . str_replace ( 'XXX',$name, translate ( 'Subject XXX' ) ) . "\"\n" . str_replace ( 'XXX', date_to_str ( $thisdate ), translate ( 'Date XXX' ) ) . "\n" . ( ! empty ($eventtime ) && $eventtime != '-1' ? str_replace ( 'XXX', display_time ( '', 2,$eventstart, get_pref_setting ( $partlogin[$i], 'TIME_FORMAT' ) ), translate ( 'Time XXX' ) ) : '' ) . "\n\n", // Apply user's GMT offset and display their TZID. get_pref_setting ( $partlogin[$i], 'EMAIL_HTML' ), $login_email ); } } } // Instead of deleting from the database... // mark it as deleted by setting the status for each participant to "D" // (instead of "A"/Accepted, "W"/Waiting-on-approval or "R"/Rejected). if ($override_repeat ) { dbi_execute ( 'INSERT INTO webcal_entry_repeats_not ( cal_id, cal_date, cal_exdate ) VALUES ( ?, ?, ? )', array ( $id,$date, 1 ) ); // Should we log this to the activity log??? } else { // If it's a repeating event, delete any event exceptions that were entered. if ( $event_repeats ) {$res = dbi_execute ( 'SELECT cal_id FROM webcal_entry WHERE cal_group_id = ?', array ( $id ) ); if ($res ) { $ex_events = array (); while ($row = dbi_fetch_row ( $res ) ) {$ex_events[] = $row[0]; } dbi_free_result ($res ); for ( $i = 0,$cnt = count ( $ex_events );$i < $cnt;$i++ ) { $res = dbi_execute ( 'SELECT cal_login FROM webcal_entry_user WHERE cal_id = ?', array ($ex_events[$i] ) ); if ($res ) { $delusers = array (); while ($row = dbi_fetch_row ( $res ) ) {$delusers[] = $row[0]; } dbi_free_result ($res ); for ( $j = 0,$cnt = count ( $delusers );$j < $cnt;$j++ ) { // Log the deletion. activity_log ( $ex_events[$i], $login,$delusers[$j],$log_delete, '' ); dbi_execute ( 'UPDATE webcal_entry_user SET cal_status = ? WHERE cal_id = ? AND cal_login = ?', array ( 'D', $ex_events[$i], $delusers[$j] ) ); } } } } } // Now, mark event as deleted for all users. dbi_execute ( 'UPDATE webcal_entry_user SET cal_status = \'D\' WHERE cal_id = ?', array ( $id ) ); // Delete External users for this event dbi_execute ( 'DELETE FROM webcal_entry_ext_user WHERE cal_id = ?', array ($id ) ); } } else { // Not the owner of the event, but participant or noncal_admin. // Just set the status to 'D' instead of deleting. $del_user = ( ! empty ($other_user ) ? $other_user :$login ); if ( ! empty ( $user ) &&$user != $login ) { if ($is_admin || $my_event || ($can_edit && $is_assistant ) || ( access_is_enabled () && access_user_calendar ( 'edit',$user ) ) ) { $del_user =$user; } else // Error: user cannot delete from other user's calendar. $error = print_not_auth (6); } if ( empty ($error ) ) { if ( $override_repeat ) { dbi_execute ( 'INSERT INTO webcal_entry_repeats_not ( cal_id, cal_date, cal_exdate ) VALUES ( ?, ?, ? )', array ($id, $date, 1 ) ); // Should we log this to the activity log??? } else { dbi_execute ( 'UPDATE webcal_entry_user SET cal_status = ? WHERE cal_id = ? AND cal_login = ?', array ( 'D',$id, $del_user ) ); activity_log ($id, $login,$login, $log_reject, '' ); } } } }$ret = getValue ( 'ret' ); $return_view = get_last_view (); if ( ! empty ($ret ) ) { if ( $ret == 'listall' )$url = 'list_unapproved.php'; else if ( $ret == 'list' )$url = 'list_unapproved.php' . ( empty ( $user ) ? '' : '?user=' .$user ); } else if ( ! empty ( $return_view ) ) do_redirect ($return_view ); else $url = get_preferred_view ( '', empty ($user ) ? '' : 'user=' . $user ); // Return to login TIMEZONE. set_env ( 'TZ',$TIMEZONE ); if ( empty ( $error ) && empty ($mailerError ) ) { do_redirect ( $url ); exit; } // Process errors.$mail->MailError ( $mailerError,$error ); ?> 

     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34   0 && ( $is_admin ||$readonly == 'N' ) ) { $layeruser =$layers[$id]['cal_layeruser']; dbi_execute ( 'DELETE FROM webcal_user_layers WHERE cal_login = ? AND cal_layeruser = ?', array ($layer_user, $layeruser ) ); } do_redirect ( 'layers.php' . ($updating_public ? '?public=1' : '' ) ); ?> 

     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191  getDescription (); $filedata =$doc->getData (); $filename =$doc->getName (); $id =$doc->getId (); $mimetype =$doc->getMimeType (); $owner =$doc->getLogin (); $size =$doc->getSize (); $type =$doc->getType (); } dbi_free_result ( $res ); } // Make sure this user is allowed to look at this file. // If the blob is associated with an event, then the user must be able // to view the event in order to access this file. // TODO: move all this code (and code in view_entry.php) to a common // function named can_view_event or something similar.$can_view = false; $is_my_event = false;$is_private = $is_confidential = false;$log = getGetValue ( 'log' ); $show_log = ! empty ($log ); if ( empty ( $id ) )$can_view = true; // not associated with an event if ( ! empty ( $id ) && empty ($error ) ) { if ( $is_admin ||$is_nonuser_admin || $is_assistant )$can_view = true; if ( empty ( $id ) ||$id <= 0 || ! is_numeric ( $id ) )$error = str_replace ( 'XXX', $id,$invalidIDStr ); if ( empty ( $error ) ) { // is this user a participant or the creator of the event?$res = dbi_execute ( 'SELECT we.cal_id FROM webcal_entry we, webcal_entry_user weu WHERE we.cal_id = weu.cal_id AND we.cal_id = ? AND ( we.cal_create_by = ? OR weu.cal_login = ? )', array ( $id,$login, $login ) ); if ($res ) { $row = dbi_fetch_row ($res ); if ( $row &&$row[0] > 0 ) { $can_view = true;$is_my_event = true; } dbi_free_result ( $res ); } if ( ($login != '__public__') && ($PUBLIC_ACCESS_OTHERS == 'Y') ) {$can_view = true; } if ( ! $can_view ) {$check_group = false; // if not a participant in the event, must be allowed to look at // other user's calendar. if ( $login == '__public__' ) { if ($PUBLIC_ACCESS_OTHERS == 'Y' ) $check_group = true; } else { if ($ALLOW_VIEW_OTHER == 'Y' ) $check_group = true; } // If$check_group is true now, it means this user can look at the // event only if they are in the same group as some of the people in // the event. // This gets kind of tricky. If there is a participant from a different // group, do we still show it? For now, the answer is no. // This could be configurable somehow, but how many lines of text would // it need in the admin page to describe this scenario? Would confuse // 99.9% of users. // In summary, make sure at least one event participant is in one of // this user's groups. $my_users = get_my_users ();$cnt = count ( $my_users ); if ( is_array ($my_users ) && $cnt ) {$sql = 'SELECT we.cal_id FROM webcal_entry we, webcal_entry_user weu WHERE we.cal_id = weu.cal_id AND we.cal_id = ? AND weu.cal_login IN ( '; $query_params = array ();$query_params[] = $id; for ($i = 0; $i <$cnt; $i++ ) { if ($i > 0 ) { $sql .= ', '; }$sql .= '?'; $query_params[] =$my_users[$i]['cal_login']; }$res = dbi_execute ( $sql . ' )',$query_params ); if ( $res ) {$row = dbi_fetch_row ( $res ); if ($row && $row[0] > 0 )$can_view = true; dbi_free_result ( $res ); } } // If we didn't indicate we need to check groups, then this user // can't view this event. if ( !$check_group && ! access_is_enabled () ) $can_view = false; } }$hide_details = ( $login == '__public__' && ! empty ($OVERRIDE_PUBLIC ) && $OVERRIDE_PUBLIC == 'Y' ); // If they still cannot view, make sure they are not looking at a nonuser // calendar event where the nonuser is the _only_ participant. if ( empty ($error ) && ! $can_view && ! empty ($NONUSER_ENABLED ) && $NONUSER_ENABLED == 'Y' ) {$nonusers = get_nonuser_cals (); $nonuser_lookup = array (); for ($i = 0, $cnt = count ($nonusers ); $i <$cnt; $i++ ) {$nonuser_lookup[$nonusers[$i]['cal_login']] = 1; } $res = dbi_execute ( 'SELECT cal_login FROM webcal_entry_user WHERE cal_id = ? AND cal_status in ( \'A\', \'W\' )', array ($id ) ); $found_nonuser_cal =$found_reg_user = false; if ( $res ) { while ($row = dbi_fetch_row ( $res ) ) { if ( ! empty ($nonuser_lookup[$row[0]] ) )$found_nonuser_cal = true; else $found_reg_user = true; } dbi_free_result ($res ); } // Does this event contain only nonuser calendars as participants? // If so, then grant access. if ( $found_nonuser_cal && !$found_reg_user ) $can_view = true; } if ( empty ($error ) && ! $can_view )$error = print_not_auth (8); } if ( ! empty ( $error ) ) { print_header (); echo print_error ($error, true) . print_trailer (); exit; } $disp = ($type == 'A' ? 'attachment' : 'inline' ); // Print out data now. Header ( 'Content-Length: ' . $size ); Header ( 'Content-Type: ' .$mimetype ); $description = preg_replace ( "/\n\r\t+/", ' ',$description ); Header ( 'Content-Description: ' . $description ); // Don't allow spaces in filenames. //$filename = preg_replace ( "/\n\r\t+/", "_", $filename ); //Header ( "Content-Disposition:$disp; filename=$filename" ); Header ( 'Content-Disposition: filename=' .$filename ); echo $filedata; exit; ?>  Added docadd.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245   0 )$is_my_event = true; // user is participant dbi_free_result ( $res ); } } if ($type == 'A' ) { if ( empty ( $ALLOW_ATTACH ) ||$ALLOW_ATTACH != 'Y' ) $error = print_not_auth (9); else if ( empty ($error ) && $ALLOW_ATTACH_PART == 'Y' &&$is_my_event ) $can_add = true; else if ($ALLOW_ATTACH_ANY == 'Y' ) $can_add = true; } else if ($type == 'C' ) { if ( empty ( $ALLOW_COMMENTS ) ||$ALLOW_COMMENTS != 'Y' ) $error = print_not_auth (10); else if ( empty ($error ) && $ALLOW_COMMENTS_PART == 'Y' &&$is_my_event ) $can_add = true; else if ($ALLOW_COMMENTS_ANY == 'Y' ) $can_add = true; } //check UAC if ( access_is_enabled () ) {$can_add = $can_add || access_user_calendar ( 'edit',$user ); } if ( ! $can_add )$error = print_not_auth (6); if ( ! empty ( $error ) ) { print_header (); echo print_error ($error ); echo print_trailer (); exit; } // Handle possible POST first if ( empty ( $REQUEST_METHOD ) )$REQUEST_METHOD = $_SERVER['REQUEST_METHOD']; if ($REQUEST_METHOD == 'POST' ) { // get next id first $res = dbi_execute ( 'SELECT MAX( cal_blob_id ) FROM webcal_blob' ); if ( !$res ) die_miserable_death ( str_replace ( 'XXX', dbi_error (), translate ( 'Database error XXX.' ) ) ); $row = dbi_fetch_row ($res ); $nextid = ( ! empty ($row ) ? $row[0] + 1 : 1 ); dbi_free_result ($res ); if ( $type == 'C' ) { // Comment$description = getValue ( 'description' ); $comment = getValue ( 'comment' ); if ( ! dbi_execute ( 'INSERT INTO webcal_blob ( cal_blob_id, cal_id, cal_login, cal_name, cal_description, cal_size, cal_mime_type, cal_type, cal_mod_date, cal_mod_time, cal_blob ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )', array ($nextid, $id,$login, NULL, $description, 0, 'text/plain', 'C', date ( 'Ymd' ), date ( 'His' ), NULL ) ) )$error = db_error (); else { if ( ! dbi_update_blob ( 'webcal_blob', 'cal_blob', "cal_blob_id = $nextid",$comment ) ) $error = db_error (); else { // success! redirect to view event page activity_log ($id, $login,$login, LOG_COMMENT, '' ); do_redirect ( "view_entry.php?id=$id" ); } } } else if ($type == 'A' ) { // Attachment $description = getValue ( 'description' ); if ( ! empty ($_FILES['FileName'] ) ) $file =$_FILES['FileName']; if ( empty ( $file['file'] ) )$error = 'File Upload error!
'; //print_r ( $file ); exit;$mimetype = $file['type'];$filesize = $file['size'];$filename = $file['name'];$tmpfile = $file['tmp_name']; if ( empty ($description ) ) $description =$filename; $data = '';$fd = @fopen ( $tmpfile, 'r' ); if ( !$fd ) die_miserable_death ( "Error reading temp file: $tmpfile" ); if ( ! empty ($error ) ) { while ( ! feof ( $fd ) ) {$data .= fgets ( $fd, 4096 ); } } fclose ($fd ); $comment = getValue ( 'description' ); if ( ! dbi_execute ( 'INSERT INTO webcal_blob ( cal_blob_id, cal_id, cal_login, cal_name, cal_description, cal_size, cal_mime_type, cal_type, cal_mod_date, cal_mod_time, cal_blob ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )', array ($nextid, $id,$login, $filename,$description, $filesize,$mimetype, 'A', date ( 'Ymd' ), date ( 'His' ), NULL ) ) ) $error = db_error (); else { if ( ! dbi_update_blob ( 'webcal_blob', 'cal_blob', "cal_blob_id =$nextid", $data ) ) {$error = db_error (); } else { // success! redirect to view event page activity_log ( $id,$login, $login, LOG_ATTACHMENT,$filename ); do_redirect ( "view_entry.php?id=$id" ); } } } else { die_miserable_death ( 'Unsupported type' ); // programmer error } if ( ! empty ($error ) ) { print_header (); echo print_error ( $error ); echo print_trailer (); exit; } } print_header (); ?>  Added docdel.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89  getEventId ();$name = $doc->getName ();$owner = $doc->getLogin ();$type = $doc->getType (); if ($owner == $login || user_is_assistant ($login, $owner ) )$can_delete = true; } else // document not found $error = str_replace ( 'XXX',$blid, translate ( 'Invalid entry id XXX.' ) ); dbi_free_result ( $res ); } if ( empty ($error ) && ! $can_delete &&$event_id > 0 ) { // See if current user is creator of associated event $res = dbi_execute ( 'SELECT cal_create_by FROM webcal_entry WHERE cal_id = ?', array ($event_id ) ); if ( $res ) { if ($row = dbi_fetch_row ( $res ) ) {$event_owner = $row[0]; if ($event_owner == $login || user_is_assistant ($login, $event_owner ) )$can_delete = true; } dbi_free_result ( $res ); } } if ( empty ($error ) && ! $can_delete )$error = print_not_auth (6); if ( empty ( $error ) &&$can_delete ) { if ( ! dbi_execute ( 'DELETE FROM webcal_blob WHERE cal_blob_id = ?', array ( $blid ) ) )$error = db_error (); else { if ( $event_id > 0 ) {$removeStr = translate ( 'Removed' ); if ( $type == 'A' ) activity_log ($event_id, $login,$login, LOG_ATTACHMENT, $removeStr . ': ' .$name ); elseif ( $type == 'C' ) activity_log ($event_id, $login,$login, LOG_COMMENT, $removeStr ); } if ($event_id > 0 ) do_redirect ( 'view_entry.php?id=' . $event_id ); do_redirect ( get_preferred_view () ); } } // Some kind of error... print_header (); echo print_error ($error ) . print_trailer (); ?> 

     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029   WebCalendar System Administrator's Guide

WebCalendar Version: 1.2.7

Introduction

WebCalender is an open source PHP-based multi-user calendar.

Features:

• Multi-user support
• Group support
• View day-at-glance
• View month-at-glance
• View week-at-glance
• View year-at-glance
• View another user's calendar
• View multiple users' calendars at the same time
• View one or more users' calendar via layers on top of your own calendar
• Public calendar (that requires no login) where anonymous users submit events that are approved by an administrator
• Repeating events
• Custom event fields
• Search interface for calendar entries
• User-configurable preferences for colors, 12/24 time format, Week start on Sun or Mon, default work hours
• Checks for scheduling conflicts
• Support for multiple timezones
• Users can accept or reject events added by another user to their calendar
• Email reminders
• Email notifications for new events
• Support for 30 different languages:
• Basque
• Bulgarian
• Catalan
• 繁體中文(Big5)
• 简体中文(GB2312)
• Czech
• Danish
• Deutsche (German)
• English
• Español (Spanish)
• Estonian
• Français (French)
• Galician
• Greek
• Hollands (Dutch)
• Holo (Taiwanese)
• Hungarian
• Icelandic
• Italiano (Italian)
• Japanese (EUCJP, SJIS)
• Korean
• Norsk (Norwegian)
• Polish
• Portuguese
• Portuguese/Brazil
• Romanian
• Русско (Russian)
• Suomalainen (Finnish)
• Svensk (Swedish)
• Turkish
• Welsh
• Exporting to and importing from:
• Palm Pilot
• iCalendar
• vCalendar
• hCalendar (import only, requires PHP5)
• Authentication using:
• web-based
• HTTP authentication
• LDAP
• NIS
• IMAP
• support for external application authentication ( Postnuke, Joomla )
• Activity log that tracks:
• event creation
• event acceptance
• event rejection
• email reminders
• Synchronization and Syndication:
• Two-way authenticated iCalendar (ics) sync
• Anonymous iCalendar (ics) publishing

System Requirements

• PHP 4.1 - PHP 5: some features specific version:
• two-way iCalendar sync: PHP 4.3+
• hCalendar importing: PHP 5+
• Database (see below)
• CSS-enabled browser:
• Microsoft Internet Explorer
• Mozilla Firefox
• Opera
• Apple Safari
• JavaScript-enabled browser
• If not using HTTP-based authentication, then browser cookies are required

Recommended:

You must have one of the following databases installed:

• MySQL
• Oracle 8+
• PostgreSQL
• Interbase
• MS SQL Server
• SQLLite (PHP5)
• IBM DB2
• ODBC

TIPPHP ODBC includes support for Adabas D, Solid and Sybase SQL Anywhere as well as ODBC. PHP5 comes bundled with SQLite support. SQLite is an embedded file-based database. If your hosting service supports PHP5, you should be able to create as many SQLite databases as you like (since each database is just a file).

For the database you choose, you must have its drivers built into PHP. For example, to use MySQL, PHP must be compiled with MySQL support (which is the default setting when installing PHP). See the PHP pages (www.php.net ) for more information on setting up PHP.

No optional PHP packages (other than MySQL) are required for this application. However, PHP should be compiled with --enable-track-vars on some systems.

TIPIf you want to use gradient background images, PHP must be compiled with the GD library.

You can run PHP either as a CGI or an Apache module. You'll get better performance with PHP setup as a module. Not only will you not have to deal with the CGI performance hit, but you'll be able to use PHP's database connection pooling. Additionally, this application can use a form/cookie-based authentication or traditional HTTP authentication. For traditional HTTP authentication, PHP must be built as an Apache module.

If you are planning on using email reminders, you will need to build PHP as a CGI in order to run the send_reminders.php script. I would strongly recommend building a module-based PHP for your web server and then a second PHP build to create the CGI version.

TIP Some Linux distributions come with both a module-based PHP with Apache and a standalone PHP binary. Check for /usr/bin/php to see if you already have the PHP standalone executable. If it's there, you can use the following command to see what version of PHP you have:

/usr/bin/php -v

File Unpacking

Unpack the calendar software in its own directory somewhere where your web server will find it. (See your web server documentation for information.)

By default, unpacking WebCalendar will create its own directory when you unpack it. The new directory name will typically contain the version name (such as WebCalendar-1.2.7). You can rename this directory after unpacking the files if you prefer a directory name like calendar or webcalendar. Keep in mind that unless you remap the directory (via your web server's configuration settings), it will be part of the URL for the calendar.

Application Installation

WebCalendar now includes an installation script that will guide you through the entire installation process. It should run automatically when first accessing a new installation or when a major version upgrade has been performed. The installation script can always be rerun if needed by adding install/index.php to your base WebCalendar URL.

WebCalendar Installation Wizard: Step 1

When first run, the installation script will prompt you for a Configuration Wizard Password that will protect against unauthorized tampering. Until this password is set, your WebCalendar installation and possibly your database are vulnerable to attack. Once, you've set your password, be sure to write it down. If forgotten, the only way to recover is to manually edit the install/settings.php file.

The installation script will now check several prerequisites and report the results. Any item that appears in RED should be corrected before continuing.

Prerequisite FailedRecommended Solution
Safe Mode* = Off If possible, change this setting in your php.ini file to Off.
Safe Mode Allowed Vars* If unable to to set Safe Mode Off, then set safe_mode_allowed_vars to contain TZ in your php.ini file.
* NOTE: If neither of the these settings pass testing, then your WebCalendar installation will be restricted to using the server's timezone setting only.
File Uploads If disabled, then some features of WebCalendar will not function. This setting is configurable in your php.ini or httpd.conf files as file_uploads
CRYPT_STD_DES This setting should be able to be ignored. We now support multiple crypt algorithms. If this setting is not enabled and you experience difficulties logging in, please notify the WebCalendar development team.
GD This library is required only if gradient background images are desired. Normally, PHP must be compiled with this option. Some installations only require it be enabled in your php.ini file.
Session Check PHP Sessions are used during the installation process and are required for proper operation. Sessions can be configured in your php.ini file. If it's not possible to enable sessions, then you must manually install WebCalendar. Details are available in Appendix F
Settings.php Status The installation script was either unable to create, or unable to write to your settings.php file. You will need to modify the permissions of the includes directory. On Linux/UNIX, you should change this directory to be read/write for all users (chmod 777 includes). On Windows, change this directory to have full access for all users using Windows Explorer.

WebCalendar Installation Wizard: STEP 2

The installation script can create your WebCalendar database as well as create all the required tables and pre-populate them with the basic configuration data. These features are only available when using fully supported database types. See Appendix B to manually create your database if needed.

Database Status

Displays the current status of your database settings as well the supported databases for your PHP installation.

Database Settings

To configure your database access. Set the values for:

Database Typedb_type One of "mysql", "oracle", "postgresql", "odbc", "mssql", sqllite, db2, or "ibase"
Serverdb_host The hostname that database is running on. (Use localhost if it's the same machine as the web server.) (This variable is not used with ODBC, enter 'none') (Use 'none' if your db server does not use a TCP socket to connect) (If using a special PORT, you can specify it as HOST:PORT)
(Use 'none' if your db server does not use a TCP socket to connect.) (Not used for SQLite.)
Database Namedb_database The name of the database that the calendar tables reside in. ("intranet" in the examples above.) For ODBC, this should be the DSN. For SQLite, this is the filename that will be used.
Connection Persistencedb_persistent Enable use of persistent (pooled) database connections. This should typically be enabled. This setting may be disabled for CGI installations.
Database Cache Directorydb_cachedir To enable caching of database query results, enter a writable directory. This directory should NOT be in the webserver document path to prevent unauthorized access to cached sensitive data such as passwords hashes and private event details. To disable this feature, leave this field blank. However, this feature is recommended to enhance your system's performance.

Click the Test Settings button to perform the test your settings.

Click the Create button to have the installation script create your database. This option will only be available for fully supported database types. Retest your database settings if prompted to do so.

TIPIf this step does not complete properly, then you will have to manually create your database. Detailed instructions can be found in Appendix B. Then rerun the installation script to continue the installation.

WebCalendar Installation Wizard: STEP 3

In this section we will perform the required database changes to bring your database up to the required level If you are using a fully supported database, this step will be performed automatically for you If not, the required SQL can be displayed and you should be able to cut & paste it into your database server query window.

Database Status

This should display the current installed version of WebCalendar as well as the version being installed.

The following database actions are required

If using a fully supported database type, clicking the Update Database button will create any tables required for this installation or upgrade. If this feature is not supported, then this button will not be available.

The Display Required SQL button will always be available and if clicked will display the required SQL text that can then be cut & pasted into the SQL query window of your database program. If using the approach, please rerun the installation script after completing your required database updates.

TIPIf this step does not complete properly, then you will have to manually create your database tables. Detailed instructions can be found in Appendix F. Then rerun the installation script to continue the installation.

WebCalendar Installation Wizard: STEP 4

Timezone Conversion

If upgrading WebCalendar from a previous version, you may be prompted to perform a Timezone Conversion. WebCalendar version 1.0.4 and earlier stored event date and time in the server's timezone. As of v1.1.0, all event date and time information is stored as UTC time. So, a one-time conversion of existing events will required to prevent event displayed times from appearing incorrectly.

Application Settings

Application Name: The default value Title will be translated into WebCalendar into the user's language. Any other entry will not be translated unless entries are made into the appropriate language.txt files.

Server URL: This should be the full URL to access your WebCalendar installation.The trailing "/" is required for proper operation. If this field is left blank, WebCalendar will calculate the proper value and store it in the database.

User Authentication: You can configure the calendar to run in single-user* mode or multi-user* mode. If this is your first time using the calendar, it's easier to try single-user. You can always switch to multi-user later. Leave single_user set to "false" (the default) for multi-user or set it to "true" and set the value of single_user_login to a login name of your liking to set the system to single-user mode. (And be sure to set the value of single_user_login to the login that you would choose if you decide to switch to multi-user mode some day.)

Note: If you do decide to switch from single-user mode to multi-user mode, make sure you add in a user to the system for the login you set the single_user_login variable to. You will need to do this via the database (mysql, sqlplus, etc.) Look in the tables-mysql.sql (or tables-oracle.sql, etc.) to see the example of adding in the "admin" user.

If you are setting up a multi-user calendar, you will need to choose how your users are authenticated. You must change the settings of use_http_auth and user_inc to setup which authentication method to use.

You currently have five choices:

use_http_auth = false
user_inc = user.php
use_http_auth = true
user_inc = user.php
... and don't forget to setup your web server to handle user authentication.
Note: In order to use HTTP-based authentication, PHP must be setup as a module for your server rather than a CGI.
use_http_auth = false
user_inc = user-nis.php
Additional configuration settings will need to be set in includes/user-nis.php.
use_http_auth = false
user_inc = user-ldap.php
Additional configuration settings will need to be set in includes/user-ldap.php.
use_http_auth = false
user_inc = user-imap.php
Additional configuration settings will need to be set in includes/user-imap.php.

Environment: Normally set this Production. Development will allow more verbose sql logging and should not be used unless needed.

After saving your settings, you should be provided with a Launch WebCalendar button that will open WebCalendar in a separate browser window.

Congratulations! You have successfully installed WebCalendar on your system.

Keep in mind that if you want to use reminders, you will need to setup the send_reminders.php script (see below) and keep your admin setting for "Email enabled" set to "Yes" on the admin settings page.

At this point, your WebCalendar installation should be up and running. To access WebCalendar open up your favorite web browser and type in the URL. The URL will depend on where you installed WebCalendar.

TIP On a multi-user system, the only user account created during installation has the username of "admin" and a password of "admin". You should create a new admin account and delete this one for security reasons.

Configuring as Event Calendar

If you intend to use WebCalendar as an event calendar, you will need to enable "Public Access" in the System Settings with the following steps:

• Click on the "Admin" link at the bottom of any page.
• Click on the "System Settings" button.
• Click on the "Public Access" tab.
• Select "Yes" for "Allow public access".

This will allow users to access WebCalendar without a username and password. Only events that are created with the "Public User" as an event participant will show up in your event calendar for users who have not logged in. If events are not showing up on your public calendar, make sure the events have the "Public User" as a participant and the event has been approved.

Creating Users

2. Click on the "Admin" link at the bottom of any WebCalendar page
3. Click on the "Users" button
5. Fill out the form with details for the new user (email address is optional)
6. Click on the "Save" button

TIP On a single-user system, you do not need to create any users.

TIP For an event calendar, you do not need to create a user for the "public user".

Setting Up Email Reminders

PHP does not come with a utility for executing time-based jobs. So, in order to check periodically for email reminders, a shell script was written in PHP. You will need two things to get this working:

1. You should have a version of PHP built as a CGI (so that you can run php from the command line). This does not mean you must build all of PHP as a CGI. You can still build PHP as a module for your web server and then build the CGI-based PHP later.
Note: Many Linux distributions and some Windows LAMP packages come with the PHP built for CGI.
2. You must setup cron (on Linux/UNIX) or something like cron for Windows to run the send_reminders.php script periodically.

Building PHP as a CGI is outside the scope of these instructions. But, if you read the PHP instructions, you'll see that the default build settings will build the CGI-based PHP. If you really can't do this (perhaps you don't have permission to install anything new on the system), skip down a couple of paragraphs to an alternate solution that does not require PHP CGI.

For Linux/UNIX users, add the following line to the crontab entry of a user. (This would be the same user that the web server process runs as.)

1 * * * * cd /some/directory/webcalendar/tools; ./send_reminders.php

Of course, replace the directory location to wherever the send_reminders.php file can be found. If you moved this out of the tools directory (which is recommended for security reasons), be sure to update send_reminders.php since it needs to know where to find other WebCalendar files.

If you cannot setup PHP as a CGI or have no idea how, you can leave send_reminders.php in its current location and access it via a URL. IMHO, this is not the best choice, but it still works. Setup a cron job to access the URL. For Linux/UNIX users, add the following line to the crontab entry of a user.

1 * * * * wget http://yourserverhere/webcalendardirectoryhere/tools/send_reminders.php > /dev/null

Some users have reported the following works better for their configuration.

1 * * * * wget -q -O /dev/null http://yourserverhere/webcalendardirectoryhere/tools/send_reminders.php

You should test this from the command line first to make sure your setup is correct. If you do not have wget installed on your system, you can use any tool (lynx, perl script, etc.) that is capable of making an HTTP request for this.

System Settings

System Settings allows the administrator to control what features are available to users as well as default values for certain features.

Many of these settings can be overridden by users in their Preferences (such as color). These user configurable settings are identified by Italics.

Settings

Application Name
Specifies the document title (typically displayed in the window title bar of most browsers)
Server URL
Specifies the base URL of the calendar. This information is needed to accurately include URLs in email messages (Notifications and Reminders).
Home URL
Language
Specifies the default language setting for all users.
Server Timezone Selection
Allows you to manually set your server's WebCalendar timezone selection. This has no effect on the OS Timezone settings.
Allow user to use themes
Allows users to have access to pre-defined themes that can set color or user preference settings. There are a few examples available in the themes folder.
Themes
The default theme that will be applied to all users unless they make their own changes.
Turns on the NEW menu system for all users.
Date Selectors position
Determines position of Date Pulldown Selectors. Either inside the NEW menu or in their original location at the bottom of the calendar.
Theme to be used with NEW menu.
Fonts
Specifies your preferred font. Multiple font names should be comma-separated.
Custom script/stylesheet
Place any custom stylesheet information or JavaScript that will be included on all WebCalendar pages.
The custom header allows you to specify HTML to be placed after the <body> tag but before any WebCalendar content and included on all WebCalendar pages.
Custom trailer
The custom trailer allows you to specify HTML to be placed after the WebCalendar content but before the </body> tag and included on all WebCalendar pages.
If enabled, then the Custom header and Custom trailer settings can specify a filename on the server rather than HTML.
If enabled, then users can add their own custom HTML for both the header (top of the page) and trailer (bottom of the page) to customize the appearance of all pages.
Preferred View
Specify if users should see the day, week, month, or year after logging in.
Display small months
Specifies whether small months are included in month, week, day views.
Display weekends
Specifies whether weekends are included in month, week, day, and views.
Display all days in month view
Specifies whether the complete month grid is filled with days from previous and next month.
Display days with events in bold in month and year views
Highlights and bolds the text for days containing events in the mini-calendars used in day, month and year calendars.
Display description in printer day view
If enabled, then the "printer friendly" view of the day view will include full event descriptions rather than just the event name.
Display Common Use Date/Times as GMT
Sets the timezone to used for General Purpose dates. Either GMT of the Server timezone will be selected.
Date format
Specifies the default format for displaying dates. These are defined in file includes/date_formats.php and if LANGUAGE DEFINED is selected then the format will be adjusted based on the format in the user's language.txt file.
Time format
Specifies the default time format as either 12-hour (3:45pm) or 24-hour (15:14)
Display 00 minutes always
Specifies whether times on the hour ( 10:00 ) are displayed with trailing 00.
Entry interval
Specify the default options for entry start and stop times. This values will also determine the display resolution of timebar views as well as user availability.
Time interval
Specify the default number of minutes each time block represents in the day and week display
Auto-refresh calendars
If set to "yes," the day, week, and month pages will automatically reload after a specified duration
Auto-refresh time
Specifies how long to wait before the auto-refresh should force a page to be reloaded
Require event approvals
If enabled, then events added to one user's calendar by another user will require approval.
Display unapproved
Specifies whether events that have been added to a calendar but not yet approved should display on the calendar (in a different color)
Display week number
Specifies whether the week number should be displayed in month and week views
Week starts on
Specifies if week start on Sunday or Monday
Work hours
Specifies the default time range to display in day and week views
Disable Pop-Ups
Determines whether event pop-ups are displayed.
Disable Location field
Determines whether to use the Location field for events.
Disable Priority field
If enabled, the Priority field will not be used
Disable Access field
If enabled, the Access field will not be used
Disable Participants field
If enabled, the Participants field will not be used, and users will not be able to add events to any calendar other than their own.
Disable Repeating field
If enabled, users will not be able to create repeating events
Display Site Extras in popup
If enabled, custom event fields configured in site_extras.php will appear in the mouse-over popups containing additional event information.
Display Participants in popup
If enabled, event participants will be included in popup details.
Allow HTML in Description
Allow the use of HTML in the description field when creating events. In addition, with the addition of either of two optional packages (HTMLArea or FCKEditor), you can have a WYSIWYG interface. These packages are available on WebCalendar's Home Page
Allow viewing other user's calendars
If enabled, users will be able to view the calendar of another user
If enabled, Views will include a link to quickly add events to the specified user's calendar.
If enabled, when a returning calendar user reaches the login page, their login name will be pre-filled with the last login username that they entered. (The password field will still be blank.)
Check for event conflicts
Specifies if the system should check for scheduling conflicts when a user adds or updates an event.
Conflict checking months
If conflict checking is enabled, this specifies how many months past the initial date the system will check for conflicts when a user adds or updates a repeating event.
Allow users to override conflicts
If enabled, users will be warned when there is an event conflict and be presented with the option of scheduling the event anyhow.
Limit number of timed events per day
If enabled, users can be limited to a specific number of timed events per day
Maximum timed events per day
Specifies that maximum number of events that can be scheduled in one day of any one user.
Specify timed event length by
Allows you to configure event lengths to be specified by either duration or end time.
Brief Description Length
Specifies the maximum numbers of characters to display in calendar views.
Display Lunar Phases in month view
Show Lunar Calendar icons in month view. This will not use existing event space.
Disable Cross-Day Events
Determines whether to display events that cross user's day boundary as multiple events.

Public Access

Allow public access
If enabled, anonymous users will be able to view the public access calendar without logging in.
Public access visible by default
If enabled, user's can go to the public access page without having to select it.
Public access is default participant
If enabled, public access will be added to every event created.
Public access can view other users
If enabled, public access user's will be able to see the calendar of other WebCalendar users. Use with caution!
If enabled, anonymous users will be able to submit new events
Public access new events require approval
If enabled, events submitted to the public access calendar (by anonymous users) will require approval by an admin user. If not enabled, then new events will appear on the public access calendar as soon as they are submitted.
Public access can view participants
If enabled, public access users can view the names of other participants for any event that public access is a participant. Use with caution!
Override event name/description for public access
If enabled, the value of the following setting will be used to mask the name and description of events.
Text to display to public access
Text to display as explained above.

User Access Control

User Access Control enabled
User Access Control provides more advanced control of user access permissions. If enabled, a "User Access Control" button will appear on the main Admin page and/or on the Settings menu of the NEW top menu. This page will allow you to configure:
• which functions in the system each user can access
• which user calendars each user can access (user A can edit events on user B's calendar, etc.)

Groups

Groups enabled
Specifies if group features should be enabled
User sees only his group
If enabled, users will be unaware of any users that are not in the same group as the user.

NonUser Calendars

Nonuser Calendars Enabled
If enabled, you may create "nonuser calendars" in WebCalendar. A nonuser calendar is a calendar without a user login. It can be used to manage a resource like a conference room's availability. Or it can be used to place common events (like holidays) that multiple users may want to access as a layer. You will need to enable nonuser calendars in order to subscribe to remote iCalendar URLs from within WebCalendar (allowing the events from an iCalendar or hCalendar file elsewhere on the net to appear in your WebCalendar calendar.)
Display in participants list at
If enabled, then nonuser calendars can be selected as participants to events.

Other

Reports enabled
If enabled, user's will be able to create and generate reports.
Allow remote subscriptions
If enabled, user's will be able enable their own subscription settings. There are currently two main ways to publish events with WebCalendar.
• publish.php will provide outbound publishing to a calendar client
• icalclient.php will provide two-way full synchronization between WebCalendar and another calendar client such as Sunbird, Apple iCal. (PHP 4.3+ required)
Allow remote calendars
If enabled, user's will be able to add a special type Non-User Calendar that includes a URL that point to the remote location. The user can manually synchronize the remote calendars if desired. In addition, tool/reload_remotes.php can be set up as a cron job to automatically reload all remote calendars as desired. Currently both iCalendar and hCalendar calendars can be consumed by WebCalendar. The calendar type should be automatically detected based on the URL and calendar content. Users will need to create a layer to make a remote calendar visible on their calendars, just like regular Non-User Calendars.
If enabled, a link is added to all pages that permits some browsers to create a persistent RSS feed to that page. Currently, only Firefox and IE 7.0 supports this functionality. Also, the setting will enable the use of the rss.php script generate RSS feeds to RSS clients. User's will also be required to enable this feature in their respective preference settings.
Categories enabled
Specifies if category features should be enabled
Specifies if category icons can be uploaded by users. This requires that a folder named icons exist in the WebCalendar directory.
If enabled, a small task window will be displayed in the month and day calendars. These tasks are compatible with the VTODO component of RFC2445 (iCalendar)
If enabled, tasks are displayed along with events in calendars. The date they appear is the due date but if the due date has passed without the task being completed, the task will shift to the current day.
Allow external users
If enabled, the create/edit event page will contain a text area to include the names (and optional email address) of event participants that are not calendar users.
If enabled, event participants entered into the External Participants area will receive email notifications at the same time as calendar users (if an email address was specified for the External Participant).
External users can receive email reminders
If enabled, event participants entered into the External Participants area will receive email reminders at the same time as calendar users (if an email address was specified for the External Participant).
Allow self-registration
If enabled, new users are permitted to setup their own accounts and log into WebCalendar without admin intervention. Use with caution!
Restrict self-registration to blacklist
If enabled, admin can configure the includes/blacklist.php to restrict or permit self-registration based on the user's IP. This will restrict access to existing users or new user's set up by admin. Details and examples are available in the top of the file.
Generate passwords and send to new users
If enabled, self-registration user's will be emailed a randomly generated password that they can then use to access WebCalendar normally. Hopefully, this will prevent some spammers and hackers from misusing the self-registration process.
Allow file attachments to events
If enabled, attachments can be uploaded and associated with events. The attachments are stored in the database, so care should be taken if performance is an issue. Additionally, permission may extended to participants and/or anyone.
If enabled, comments can be associated with events. Additionally, permission may extended to participants and/or anyone.

Email

Email enabled
Specifies if email functionality should be enabled. If set to "No," then no email messages will be sent at any time.
Specifies the email originator to use when the system sends out email Notifications and Reminders
Email Mailer
Specifies the email program to use. (PHP mail, SMTP, or sendmail)
SMTP Host name(s)
Specifies the SMTP server name(s) or IP(s) if SMTP is selected above.
SMTP Port Number
Specifies the SMTP port number if SMTP is selected above. Default is 25.
SMTP Authentication
Specifies whether authentication is required if SMTP is selected above. Additionally, SMTP Username and SMTP Password will be required.
Event reminders
Specifies if email reminders for events that include a reminder should be sent
Specifies if the system should send email when an event is added
Events updated on my calendar
Specifies if the system should send email when an event is updated
Events removed from my calendar
Specifies if the system should send email when an event is deleted
Event rejected by participant
Specifies if the system should send email when a participant to an event rejects the event

Colors

Allow user to customize colors
Specifies whether color settings should be available to users in their Preferences
Enable gradient images for background colors
If enabled, the background of calendar table cells will be rendered with a gradient image based on the background color selected for that cell type. This option requires that php be compiled with the gd module.
Document background
Specifies the background color of all pages
Document title
Specifies the color of page title on each page
Document text
Specifies the default text color on each page
My event text
Specifies the default text color for the user's events
Table grid color
Specifies color of the lines that make HTML table grids on each page
Specifies the default background for the heading of any HTML table
Specifies the default text color for the heading of any HTML table
Table cell background
Specifies the background color for table cells
Table cell background for current day
Specifies the background color for the table cell containing the current date (today)
Table cell background for days with events
Specifies the background color of table cells containing events. This setting will not override the today setting and if identical to today, will be ignored.
Table cell background for weekend
Specifies the background color for table cells that represent a Saturday or Sunday
Table cell background for other month
Specifies the background color for table cells of other month days.
Week number color
Specifies the text color for week numbers (if enabled)
Event popup background
Specifies the background color of event popup areas
Event popup text
Specifies the text color of event popup areas

Custom Event Fields

You may want to customize the event-specific fields found in the includes/site_extras.php field. If this is your first time using the calendar, you can skip this step and come back later since this step is optional.

You can use this feature to add extra fields to your calendar events. For example, you can add a URL, a contact email address, or a pulldown containing predefined attributes.

When defining a new custom field, the following types listed below are available. "Arg 1" and "Arg 2" have different meaning depending on the type of field. In some cases, "Arg 1" and "Arg 2" are not used.

Type Description Arg 1 Arg 2
EXTRA_TEXT Allows the user to enter a single line of text Specifies the size of the text form element as it would appear in the following ("NN" would be replaced with Arg 1):
<input size="NN" ...
N/A
EXTRA_MULTILINETEXT Allows the user to enter multiple lines of text Specifies how many characters wide the textform element should be as it would appear in the following ("NN" would be replaced with Arg 1):
<textarea cols="NN" ...
Specifies how many lines long the textform element should be as it would appear in the following ("NN" would be replaced with Arg 1):
<textarea rows="NN" ...
EXTRA_URL Allows the user to enter a single line of text and will be displayed as a link when viewed N/A N/A
EXTRA_DATE Allows the user to select a date using the standard date selection form elements N/A N/A
EXTRA_EMAIL Allows the user to enter a single line of text and will be displayed as a mailto URL link N/A N/A
EXTRA_USER Allows selection of a WebCalendar user from a pulldown list N/A N/A
EXTRA_RADIO Allows selection of a single item from a group of radio buttons Specifies the list of available options using the PHP array The default item that will be selected (from list above)
EXTRA_SELECTION_LIST Presents the user with a selection list (single selection) to choose from Specifies the list of available options using the PHP array function 0 indicates single selection, 1 indicates multiple selection and also the maximum size
EXTRA_CHECKBOX Will display a checkbox control N/A N/A

How do I setup PHP, MySQL and Apache on Windows?
The easiest way to do this is to try one of the prepackaged bundles that will install all of these for you:
How do I setup PHP, MySQL and Apache on Mac OS X?
You can use the built-in Apache/PHP installed on Mac OS X. However, this does not inlude MySQL. An easier way to setup WebCalendar would be to use one of the following packages:
How do I setup PHP, MySQL and Apache on UNIX/Linux?
There are many online instructions on how to do this. Here are a few:
I've finished the install. What is the login to WebCalendar?
After the initial creation of the database tables, there will be a single user account created with the username "admin" and the password set to "admin" as well.
Note: This account is intended to get your started. You should create a new admin account and delete this one.
I want to use WebCalendar as an events calendar for my organization. How do I set it up to do this?
You will want to setup WebCalendar to use public access.
1. Setup your settings.php file as a multi-user system (see instructions).
2. In System Settings, set "Allow public access" to "Yes."
3. If you want people to be able to submit new events through public access, set "Public access can add events" to "Yes."
4. If you set "Public access can add events" to "Yes", set the setting for "Public access new events require approval" to your liking. If you set this to "Yes," an admin user will need to approve any new events before they will appear on the public access calendar.
5. Login using one of the accounts you have setup. Add a new event, and select "Public User" as one of the participants.
6. If you have enabled "Require event approvals" in your System Settings, then you will need to approve the new event. Choose the "Unapproved Events" at the bottom of any page (you must be an admin user to access this). You will be presented with a list of unapproved events (for both the current user and for the Public User account). Approve the new event for the Public User.
7. Go to the Login page. You will see a "Access public calendar" link that will bring you to the calendar for public access.
8. By default, the index.php page should send users to the public calendar.
How can I add holidays to the calendar?
There is no built-in support for holidays because it is not necessary. You can add holidays into WebCalendar by importing one of the many iCalendar holiday files that are freely available. A good resource for free iCalendar files is iCalShare . For example, the U.S. holiday iCalendar file can be downloaded from:
http://icalshare.com/article.php?story=20020912105939521
If you don't want each individual user to have to import the holiday calendar, you can use nonuser calendars. First, make sure nonuser calendars are enabled in your system settings. Then, from Admin->Users, you can access nonuser calendars. Create a new nonuser calendar (such as "usholidays"). Then, notify your users that they can add this nonuser calendar as a layer to their own calendar in order to see the holidays.
Why are deleted events still present in the database?
When you delete an event from your calendar, it is not deleted from the database. Instead, it is marked as deleted. This allows the system administrator access to information even after it is deleted.
Can I setup more than one public calendar?
You cannot directly setup two public calendars. However, there are two options for emulating this type of functionality:
• You can create global categories and point users to the calendar with only a certain category displayed.
• You can setup multiple NonUser calendars and enable public access viewing of other users' calendars. You can then link directly to the calendar of one of the NonUser calendars, or you can setup a view that contains the calendar of one or more of the NonUser calendars.
How do I change the title "Public Access" at the top of the calendar?
In the file translations/English-US.txt, change the line that says "Public Access" to what you want it to say on the right side.

Example:
Public Access: Foobar Event Calendar
Can I embed WebCalendar as a component on another web page?
WebCalendar is meant to be run as a standalone web application. You can customize the appearance of WebCalendar to match your existing site. To do this, In System Settings, set both "Custom header" and "Custom trailer" to "Yes" and press the "Edit" button to enter the header and trailer content.
If you are looking to just include a list of upcoming events in one of your web pages, you can use the upcoming.php page in WebCalendar to do this. Edit the top of this file to configure options. (These settings will likely move into System Settings in subsequent release.) You can then use an iframe elsewhere on your web site as in the example below:
<iframe height="250" width="300" scrolling="yes" src="upcoming.php"></iframe>
Include this HTML anywhere on any of your pages. By default, the events from the public calendar will be loaded (so you must have "Public Access" enabled in System Settings). You can override this with another user's calendar. (See upcoming.php for instructions on this.)

If you would like to display a small calendar (like the ones on the month view), you can add the following example. There are some configuration options available in the top of this file as well. You can then use an iframe elsewhere on your web site as in the example below:
<iframe height="200" width="180" scrolling="yes" src="minical.php"></iframe>
How do I customize the appearance of WebCalendar so that it matches the rest of my site?
You can customize the appearance of WebCalendar to match your existing site. To do this, In System Settings, set both "Custom header" and "Custom trailer" to "Yes", and press the "Save" button. Then click on the "Edit" button to enter your site content. The custom header will be included after the document's HTML <body> tag but before any WebCalendar content. The custom trailer will be included after the WebCalendar content and before the document's HTML </body> tag. If you want to add JavaScript or Stylesheet data, you can use the "Custom script/stylesheet" option on the same System Settings page. Any content entered will be included within the document's HTML <head> section.
How do I add a new translation?
It's a fairly simple process. If you've ever translated a C-based app that used GNU's gettext tool, then you'll have no problem. The I18N support was based on GNU's gettext . Here's what you need to do.
1. look in the "translations" directory
2. copy the English-US.txt file into what you'd like to call your language data file. (e.g. cp English-US.txt French.txt)
3. Now translate all the text to the _right_ of the ": " into the new language. Do not alter the text to the left of the ": ".
4. When you're done making changes, move into the "tools" directory. Run the check_translation.pl script on your new data file to make sure you have all the needed translations. (e.g. perl check_translation.pl French)
5. Add the new language to both the $languages array and the$browser_languages arrays defined in includes/translate.php.
6. Test it out...
7. Post a copy of your translation (along with your changes to includes/translate.php) to the SourceForge Patches  for WebCalendar.
How do I update an existing translation?
Just open up the translation file in the translations directory with your favorite text editor (like vi, vim, emacs, pico, Notepad, etc.). In particular look for places where missing translations are indicated. All missing translations should be marked with a "<< MISSING >>" note. and typically the English version of the translation will also be included on the following line (as in the example below):
# << MISSING >> # Edit: #

For some text, an abbreviation may be used rather than the English text. In those cases, the full text will be noted as in the following example:
# << MISSING >> # custom-script-help: # English text: Allows entry of custom Javascript or stylesheet text that # will be inserted into the HTML "head" section of every page. #

When you're done making changes, move into the tools directory. Run the check_translation.pl script on your new data file to make sure you have all the needed translations:
perl check_translation.pl French
Post a copy of your translation to the SourceForge Patches  for WebCalendar.
During Import, I receive this error: Unknown Timezone: XXXXX defaulting to GMT.
This is a notice that your import file contained unknown timezone information. WebCalendar will simply save the event or task as GMT. You are encouraged to submit these notices as Bug Reports to SourceForge, so that WebCalendar can improve its TZID support.

Troubleshooting

I get error messages about undefined variables when I try to view any page.
On newer versions of PHP, the default setting of PHP is to display messages when an undefined variable is referenced. To prevent these messages from being displayed, change the setting of error_reporting in your php.ini file to be:
error_reporting = E_ALL & ~E_NOTICE
Alternately, you can disable any error messages from being displayed in the browser and have them logged to a file. (See the comments included in the php.ini file for instructions on how to do this.)
I receive an error message saying "Error removing temporary file" or "Cache error".
This indicates that a file in your database cache directory could not be deleted or created. The quickest solution to this problem is to not use the database cache. Simply remote the db_cachedir line from includes/settings.php with a simple text editor. This error is most common when the send_reminders.php script is run from a cron job under a different system account than the PHP application server is running under. This causes files created by the send_reminders.php script to be owned by a different user than normal, preventing the PHP application from being able to remove the files when needed.
I receive an error message saying "Failed opening 'includes/...' for inclusion ..."
You may have to modify the include_path setting in your php.ini file. Most users do not need to do this, but some PHP installs seem to require it. You will need to add the WebCalendar directory to the list of directories for include_path.
I get an error message from PHP saying "Call to undefined function: ..."
This tells you that your version of PHP is missing something that WebCalendar needs. If the function mentioned is a database login function (ociplogin, mysql_pconnect, ibase_connect, pg_pconnect), then you probably do not have the needed support for your database compiled into PHP. If the function is not a database connect call, then check the PHP manual  to see if the function requires a specific version of PHP. You may have an out-dated version of PHP that requires upgrading.
When I try and view certain pages, nothing happens for 30 seconds, then I get a time-out error.
On slower or very busy servers, it can take some time for the server to get all the events. Most PHP installations have a built-in timeout out of 30 seconds and will interrupt any request that takes longer than that. This is most likely to happen on the year-long custom report or on the month view when layers are being used. If you have access, you can increase the time-out value for PHP in the php.ini file by changing the setting of the max_execution_time setting.
I get an error message that says "Can't connect to local MySQL server through socket '/tmp/mysql.sock'."
This is a PHP/MySQL configuration issue. The value of mysql.default_socket in your php.ini file must match the value of socket in your my.cnf file. Edit the php.ini file to fix this problem.
I am not receiving any email messages from WebCalendar.
WebCalendar sends two types of email messages: Notifications* and Reminders*. Check the following if you are not receiving any email:
1. You have defined a valid SMTP server in your PHP configuration file php.ini. (The setting is "SMTP" in the "mail_function" section.)
2. In WebCalendar's System Settings, you have set the "Email Enabled" setting to "Yes".
3. In WebCalendar's System Settings, make sure you have the "Default sender address" to something.
Note: Some mail system will reject mail that has a "From" address that is a different domain from the originating SMTP server. So, if your SMTP server is smtp.mydomain.com and your "Default sender address" is calendar@someotherdomain.com, some mail systems may bounce the mail back.
4. For a Notification, make sure you have the type of Notification set to "Yes" in the user's Preferences.
5. For a Reminder:
• Make sure you have "Event reminders" set to "Yes" in the user's Preferences.
• Make sure you have setup a cron job to periodically run the send_reminders.php script.
Some of the pages are displaying text in English rather than <insert your language here>
The translations have been submitted at various points of WebCalendar development. Some have not been updated to include newer features.
The text that I entered in the Custom Event Fields is not being translated to different languages.
You will need to add an entry in each of the translation files for any text you add into the Custom Event Fields.
You can download the latest public release from SourceForge's file list for WebCalendar .
You can download the latest development code from the CVS server using the instructions provided by SourceForge . (You will need a CVS client to do this.)
How do I install a patch file listed on SourceForge's list of WebCalendar patches ?
Most patches are distributed as context diffs. That means they were produced using the UNIX diff command with the -C option. The patches are intended to be used with the GNU patch  program. This program is standard on most Linux systems and can be obtained as part of the Cygwin  package for Windows. Mac OS X will have the patch program installed if they install the developer tools CD.
The easiest way is to admin a new admin user and then use that new user to reset the password for your old admin account. Assuming you have deleted the original 'admin' login, you can use the following SQL to insert a new admin user into the database:
I get a database error indicating table webcal_config does not exist.
This is the first table that WebCalendar tries to access, so it typically means one of the following:
• You have not created the database tables as described in the instructions
• You have the wrong database name specified in your includes/settings.php file
I get a database error from MySQL that says "Client does not support authentication protocol."
From the MySQL 5.0 Reference Manual:
MySQL 5.0 uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older (pre-4.1) clients. If you upgrade the server from 4.0, attempts to connect to it with an older client may fail with the following message:

Client does not support authentication protocol requested by server; consider upgrading MySQL client
The MySQL Reference Manual has solutions for this problem.

Getting Help

Try the Help/Troubleshooting forum for WebCalendar, hosted at SourceForge.net:

https://sourceforge.net/forum/forum.php?forum_id=11588

If you encounter a bug, please check the list of open and pending bugs . If you do not see anything similar, submit a new bug.

Licensing

Glossary

Activity Log
A summary of recent updates to calendar data
Assistant
A calendar user that has been designated by another calendar user (the Boss) to help manage their calendar
Boss
A calendar user that has designated another calendar user (the Assistant) to help manage his calendar
External User
A calendar participant that does not have a calendar user account
Group
A mechanism of dividing up a large set of users into smaller sets of users
IMAP
Internet Message Access Protocol, an optional method of user authentication.
Layer
A function that allows a user to overlay another user's calendar on top of his own calendar so that the standard day, week and month pages show both his own and the layered user's events
LDAP
LDAP (Lightweight Directory Access Protocol) is an Internet protocol used to maintain user directories
Multi-User Mode
When WebCalendar is configured in Multi-User Mode, there can be multiple user accounts, each with his own calendar. Unless Public Access is enabled, all users will be required to login before they can access the system.
NIS
NIS (Network Information Service) is a UNIX-based user authentication system for managing user directories in a network
NonUser Calendar
A participant to a calendar event that is not a calendar user. This is typically used either as a resource (conference room, laptop computer) that needs to be shared or as a shared calendar that other users overlay onto their own calendar using layers (company-wide calendar, holiday calendar, etc.)
An email message that is sent when an event is added, removed or updated in the user's calendar by another user
Preferred View
The standard page (day, week, month or year) that will be presented to the user after logging in (set in user Preferences)
Public Access
A System Setting that will allow anonymous users to access the calendar. See the simple instructions for setting this up in the FAQ section. (Requires WebCalendar to be configured in Multi-User Mode).
Reminder
An email message that is sent before an event to remind the participant
Single-User Mode
When WebCalendar is configured in Single-User Mode, there is no concept of users. You will be managing a single calendar and no login will be required. Anyone accessing this calendar will have full privileges to view, add, edit and delete all events.
Time Interval
The amount of time each "block" will represent in either the day or week view (set in user Preferences)
User Access Control (UAC)
The fully configurable feature to allow extremely granular access control to user. This control applies to system options and features as well as other user's calendars.
View
A customized page that presents the events of selected users
Work Hours
The default hours to show in the week and day view where events are displayed in blocks of time (set in user Preferences)

If you have phpMyAdmin installed and configured to manage your MySQL database, use the following steps to setup WebCalendar. (The following information is based on phpMyAdmin version 2.6.1.)

1. On the initial phpMyAdmin page, under the "MySQL" heading, the first option should be "Create new database." Enter the name you have chosen for the database and press the "Create" button. (The default database name used by WebCalendar is "intranet".) After pressing the "Create" button, it should say: "Database <your database name here> has been created."
3. (Optional) Create new MySQL user. If you already have a MySQL login that you would like to use, you can skip this step.
• Below any existing users listed, click on the link "Add a new User."
• Fill in the details of your new database user. The default username for WebCalendar is "webcalendar" with a password of "webcal01". Leave the "Host" field set to "Any host".
• From the list of "Global privileges", be sure to select: SELECT, INSERT, UPDATE, DELETE, FILE, CREATE, ALTER, INDEX, DROP
• Click on the "Go" button.
• You should see a page that says "You have added a new user."
4. Click on the "Databases" tab at the top of the page.
5. From the list of databases on the page, click on the name of the database that you created.
6. Click on the "SQL" tab at the top of the page.
7. At the bottom of the page, there is an area to upload a SQL file. Click on the "Browse" button and select the tables-mysql.sql file in the WebCalendar toplevel directory. Then, press the "Go" button.
8. The top of the page should say "Your SQL-query has been executed successfully."
9. You have now finished creating the WebCalendar database tables.

Appendix B: Database Setup

There are three steps in setting up the database:

1. Creating the database
2. Creating the user
3. Creating the required tables

Follow the steps outlined below for the database you are using. When complete, a single user account will be created with the login "admin" and password "admin", which you are encouraged to use to create your own account.

Note: In the examples below, text in bold represents text that you must type in.

Security: The default values for database, login, and password (intranet, webcalendar, and webcal01) are for demonstration purposes only and should never be used in a production environment.

MySQL

The following will create a database named "intranet".

Next, create the database user account that will be used to access the database.

mysql --user=root mysql mysql> GRANT ALL PRIVILEGES ON *.* TO webcalendar@localhost IDENTIFIED BY 'webcal01' WITH GRANT OPTION; mysql> FLUSH PRIVILEGES; mysql> QUIT

If you will be accessing MySQL from a different machine than the one running the web server, repeat the command above and replace 'localhost' with the hostname of the other machine.

Create the calendar tables using the supplied tables-mysql.sql file:

mysql intranet < tables-mysql.sql

In the above example, "intranet" is the name of your database.

Note: If you are using phpMyAdmin to manage your MySQL database, follow the instructions in Appendix A.

Oracle

The following will create a tablespace named "webcalendar". From the command line, startup sqlplus and issue the following command:

sqlplus SQL> CREATE TABLESPACE webcalendar DATAFILE 'webcalendar.dat' SIZE 10M AUTOEXTEND ON NEXT 10M MAXSIZE 40M;

Next, create the database user account that will be used to access the database.

sqlplus SQL> CREATE USER webcalendar IDENTIFIED BY webcal01 DEFAULT TABLESPACE webcalendar; SQL> GRANT dba TO webcalendar; SQL> quit

Create the calendar tables using the supplied tables-oracle.sql file:

sqlplus webcalendar/webcal01 SQL> @tables-oracle; SQL> quit

PostgreSQL

The following will create a database named "webcalendar". From the command line as the psql user: issue the following commands:

$su postgres # createdb webcalendar # createuser --no-createdb --no-adduser -P webcalendar # psql webcalendar webcalendar \i tables-postgres.sql \q Interbase The following will create a database named "WEBCAL.gdb". From the command line, startup usql and issue the following command: CREATE DATABASE 'WEBCAL.gdb'; Create the calendar tables using the supplied tables-ibase.sql file: isql connect /path/WEBCAL.gdb; input path/table-ibase.sql; ODBC Setup will depend on which database you are using. When it comes time to create the tables, the tables-postgres.sql file should work for most databases. MSSQL Create a database, intranet, and add a user, webcalendar, to access this database. The user should be granted public, db_datareader, and db_datawriter privileges. Open SQL Query Analyzer then open the file tables-postgres.sql. Make sure you have identified intranet as the target database and Execute the contents of the sql file. Appendix C: Setting Up Reminders on Windows You have two options to choose from when setting up email reminders on a Windows platform. You can either install a cron package for Windows, or you can use the Windows Task Scheduler. Installing a Cron Package If you install a cron package for Windows, you will need to setup to setup a cron job. (UNIX cron is a tool for used to run tasks as specified times anywhere from every minute to once a year.) First, you should create a sendreminders.bat file that contains a single line: C:\your\path\to\php.exe C:\your\path\to\webcalendar\tools\send_reminders.php You can place this sendreminders.bat file anywhere on your file system. Next, you need to setup the cron job. The crontab entry should look like the following (replace with the correct path to your newly created sendreminders.bat file): 1 * * * * C:\your\path\to\sendreminders.bat The "1 * * * *" will tell the cron schedule to run this task at 1 after the hour all day long (12:01am, 1:01am, 2:01am, etc.) If you only want to run it once per day, you could use: 1 4 * * * C:\your\path\to\sendreminders.bat This would tell the cron scheduler to run the task at 4:01am every day. For more information about the syntax of cron, check the documentation for the package you have installed or view the UNIX man page for crontab (like this one). There are many cron packages for Windows available. Below is a list of packages to choose from. (Note: use at your own risk. These links are provided for information only.) Using the Windows Task Schedule Follow the steps listed below to setup a new task in the Windows Task Scheduler. (These instructions were created with Windows XP Professional. Other versions of Windows might be different.) 1. Create a new batch file called sendreminders.bat. The contents of this file should be a single line: C:\your\path\to\php.exe C:\your\path\to\webcalendar\tools\send_reminders.php 2. On Windows XP, go to Control Panel 3. Double-click on "Scheduled Tasks." This brings up a window that says "Scheduled Task Wizard" 4. Click on "Browse..." 5. Select the location of your newly created sendreminders.bat file. 6. Click on "Open" 7. Change the name of the task. "WebCalendar Reminders" is a good name. 8. Select how often to perform this task. Select "Daily." 9. Click on "Next" 10. Select the start time, then click "Next". If you are planning on sending out reminders throughout the day, pick a time shortly after midnight. 11. Enter your user password as required. Click on "Next." 12. Select the checkbox "Open advanced properties". 13. Click on "Finish." 14. Under the "Schedule" tab, click on "Advanced." 15. Click on "Repeat Task" and fill in the details of how often the job should run. For example, you can set it to run "every 15 minutes", then click on "until" and set that time to 11:30pm. Appendix D: Displaying Upcoming Events on Your Site If you would like to list upcoming events somewhere on a page on your site (someplace other than the WebCalendar pages), you can use the upcoming.php page to do this. This page is intended to be included in other pages using the iframe tag. You may need to modify some of the variables near the top of upcoming.php with a text editor:$public_must_be_enabled Specifies if Public Access must be enabled in System Settings for this page to be viewed.
Default setting: false
$display_link Specifies if events should have a link to the URL within WebCalendar to view the event. Default setting: true$link_target Specifies the name of the window that be used for the link target.
Default setting: _top
$numDays Specifies how many days of events should be listed. Can override this by passing "num" in within the URL with "upcoming.php?num=60" Default setting: 30$maxEvents Specifies the maximum number of events to list.
Default setting: 10
$username The login of the calendar to display upcoming events for. If you want to see upcoming events for user login "joe", then you would change this to "joe". Default setting: __public__ (The public calendar)$allow_user_override Specifies whether the calendar user can be specified in the URL (in which case the $username setting will be ignored) using a URL like "upcoming.php?user=joe". Default setting: true$load_layers Specifies if the calendar user's layers should also be included in the upcoming events.
Note: Layers must be enabled in the user's preferences.
Default setting: true
$cat_id Specifies a category id to filter events on. Note: Categories must be enabled in System Settings. Default setting: (empty) Below is an example of how you would include upcoming.php in a simple HTML page. <html><head><title>ACME Home Page</title></head> <body> <h1>Welcome to the ACME Home Page</h1> <h2>News</h2> <p>No news....</p> <h2>Upcoming Events</h2> <iframe src="upcoming.php" width="400" height="400" name="califrame"></iframe> </body> </html> TIP The W3 Schools site provides documentation about the different options that you can use with the iframe tag. Appendix E: How To Configure for LDAP Configuring WebCalendar to use an existing LDAP directory is fairly simple. It is know to work with OpenLDAP and Novell Edirectory and should work with other systems as well. Note: If you use LDAP, the group functionality of WebCalendar does not yet work. To configure WebCalendar to use LDAP, do the following: 1. Configure settings.php 2. Configure includes/user-ldap.php The first step is to set WebCalendar to use LDAP authentication in settings.php. Instructions on to do this can be found in the Application Installation section above. In summary, the following should be set: use_http_auth = false user_inc = user-ldap.php The next step is a little more work and involves editing the includes/user-ldap.php file with a text editor. You will have to set several configuration variables. If you don't know what to set the variables to, consult your LDAP system administrator. Documentation exists for all variables in the file. Finally, users have gotten LDAP working with OpenLDAP and Novell Edirectory by just changing the following:$ldap_server FQDN or IP address of the LDAP server (or localhost).
ex. 'ldapserver.company.com'
$ldap_base_dn Specifies the base DN used to search for users ex. 'ou=people,dc=company,dc=com' or 'o=context,ou=subcontext'$ldap_admin_group_name Specifies a group (complete DN) with admin rights for WebCalendar
You might have to create one in LDAP
ex. 'cn=it,ou=group,dc=company,dc=com'

Using SSL with LDAP

If the LDAP server will accept connections over SSL, simply add 'ldaps://' to the beginning of $ldap_server. Example: ldaps://ldapserver.company.com Using TLS with LDAP If the LDAP server is set up to use TLS, set$ldap_start_tls = true.

Using LDAPv3

If the LDAP server uses protocol version 3, set $set_ldap_version = true and$ldap_version = '3'.

Appendix F: Manual Installation

TODO

Appendix G: Error Codes

These error codes will be used along with the print_not_auth () function to give an idea of the what the problem might be without displaying site sensitive information.

Note: mode=dev must be set in includes/settings.php for these error numbers to be displayed

• ACCESS NOT ENABLED (UAC)
• ACCESS ACTIVITY LOG (UAC)
• Not my event
• Can not edit (UAC)
• Allow View Others (System Settings)
• Can not view (UAC)
• Allow Attachment (System Settings)
• Allow Comment (System Settings)
• REMOTES ENABLED (System Settings)
• REPORTS ENABLED (System Settings)
• Report user not allowed
• Report not yours
• ACCESS USER MANAGEMENT (UAC)
• ACCESS ACCOUNT INFO (UAC)
• User can not update password (user.php)
• FREEBUSY ENABLED (System Settings)
• PUBLISH ENABLED (System Settings)
• Public must be enabled
• Single User (settings.php)
• HTTP Auth (settings.php)
• Non-User calendar not public
• USER PUBLISH ENABLED (System Settings)
• ALLOW SELF REGISTRATION (System Settings)
• Report ID
• USER RSS ENABLED (User preferences)
• Categories not enabled (System Settings)
• Event deleted for this user
• User not participant
• Event status empty
• View name empty
• PUBLIC ACCESS OTHERS (System Settings)
• Invalid IP (blacklist.php)



cannot compute difference between binary files

     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644  '; for ( $i = 0;$i < $maxhour;$i++ ) { $ihour = ($TIME_FORMAT == '24' ? sprintf ( "%02d", $i ) :$i ); if ( $i == 0 &&$TIME_FORMAT == '12' ) $ihour = 12;$ret .= ' '; } $ret .= ' : ' . ($TIME_FORMAT == '12' ? ' ' : ' ' ); } $daysStr = translate ( 'days' );$hoursStr = translate ( 'hours' ); $minutStr = translate ( 'minutes' );$saveStr = translate ( 'Save' ); load_user_categories (); // Default for using tabs is enabled. if ( empty ( $EVENT_EDIT_TABS ) )$EVENT_EDIT_TABS = 'Y'; // default $useTabs = ($EVENT_EDIT_TABS == 'Y' ); // Make sure this is not a read-only calendar. $can_edit = false;$others_complete = 'yes'; $checked = ' checked="checked"';$selected = ' selected="selected"'; // Public access can only add events, not edit. if ( empty ( $login ) || ($login == '__public__' && $id > 0 ) )$id = 0; $eType = getGetValue ( 'eType' ); if ( empty ($eType ) ) $eType = 'event';$copy = getValue ( 'copy', '[01]' ); $date = getValue ( 'date', '-?[0-9]+' );$day = getValue ( 'day', '-?[0-9]+' ); $month = getValue ( 'month', '-?[0-9]+' );$year = getValue ( 'year', '-?[0-9]+' ); if ( empty ( $date ) && empty ($month ) ) { if ( empty ( $year ) )$year = date ( 'Y' ); $month = date ( 'm' ); if ( empty ($day ) ) $day = date ( 'd' );$date = sprintf ( "%04d%02d%02d", $year,$month, $day ); }$BodyX = 'onload="onLoad();"'; $INC = array ( 'js/edit_entry.php/false/' .$user, 'js/visible.php' ); $textareasize = '15'; // Can we use HTMLArea or FCKEditor? (Relax! That's the authors initials.) // Note: HTMLArea has been discontinued, so FCKEditor is preferred.$use_fckeditor = $use_htmlarea = false; if ($ALLOW_HTML_DESCRIPTION == 'Y' ) { // Allow HTML in description. // If they have installed an HTML edit widget, make use of it. if ( file_exists ( 'includes/FCKeditor-2.0/fckeditor.js' ) && file_exists ( 'includes/FCKeditor-2.0/fckconfig.js' ) ) { $textareasize = '20';$use_fckeditor = true; } else if ( file_exists ( 'includes/htmlarea/htmlarea.php' ) ) { $BodyX = 'onload="onLoad();initEditor();';$INC[] = 'htmlarea/core.php/true'; $INC[] = 'htmlarea/htmlarea.php/true';$use_htmlarea = true; } } $byday =$bymonth = $bymonthday =$bysetpos = $participants = array ();$exceptions = $inclusions =$reminder = array (); $byweekno =$byyearday = $catList =$catNames = $external_users =$rpt_count = ''; $create_by =$login; //This is the default per RFC2445 //We could override it and use $byday_names[$WEEK_START] $wkst = 'MO';$real_user = ( ( ! empty ( $user ) && strlen ($user ) ) && ( $is_assistant ||$is_admin ) ) ? $user :$login; print_header ( $INC, '',$BodyX, false, false, false, true ); ob_start (); if ( $readonly == 'Y' ||$is_nonuser ) $can_edit = false; else if ( ! empty ($id ) && $id > 0 ) { // First see who has access to edit this entry. if ($is_admin ) $can_edit = true;$res = dbi_execute ( 'SELECT cal_create_by, cal_date, cal_time, cal_mod_date, cal_mod_time, cal_duration, cal_priority, cal_type, cal_access, cal_name, cal_description, cal_group_id, cal_location, cal_due_date, cal_due_time, cal_completed, cal_url FROM webcal_entry WHERE cal_id = ?', array ( $id ) ); if ($res ) { $row = dbi_fetch_row ($res ); // If current user is creator of event, then they can edit. if ( $row[0] ==$login ) $can_edit = true;$cal_date = ( ! empty ( $override ) && ! empty ($date ) ? $date // Leave$cal_date to what was set in URL with date=YYYYMMDD. : $row[1] );$create_by = $row[0]; if ( ($user == $create_by ) && ($is_assistant || $is_nonuser_admin ) )$can_edit = true; $cal_time = sprintf ( "%06d",$row[2] ); $due_date =$row[13]; $due_time =$row[14]; $calTS = date_to_epoch ($cal_date . $cal_time ); // Don't adjust for All Day entries. if ($cal_time > 0 || ( $cal_time == 0 &&$row[5] != 1440 ) ) { $cal_date = date ( 'Ymd',$calTS ); $cal_time = date ( 'His',$calTS ); } $hour = floor ($cal_time / 10000 ); $minute = ($cal_time / 100 ) % 100; $dueTS = date_to_epoch ($due_date . $due_time );$due_date = date ( 'Ymd', $dueTS );$due_time = date ( 'His', $dueTS );$due_hour = floor ( $due_time / 10000 );$due_minute = ( $due_time / 100 ) % 100;$priority = $row[6];$type = $row[7];$access = $row[8];$name = $row[9];$description = $row[10];$parent = $row[11];$location = $row[12];$completed = ( empty ( $row[15] ) ? date ( 'Ymd' ) :$row[15] ); $cal_url =$row[16]; // What kind of entry are we dealing with? if ( strpos ( 'EM', $type ) !== false )$eType = 'event'; elseif ( strpos ( 'JO', $type ) !== false )$eType = 'journal'; elseif ( strpos ( 'NT', $type ) !== false )$eType = 'task'; // Public access has no access to tasks. // translate ( 'You are not authorized to edit this task' ) if ( $login == '__public__' &&$eType == 'task' ) echo str_replace ( 'XXX', translate ( 'task' ), translate ( 'You are not authorized to edit this XXX.' ) ); // Check UAC. if ( access_is_enabled () ) $can_edit = access_user_calendar ( 'edit',$create_by, $login,$type, $access );$day = $cal_date % 100;$month = ( $cal_date / 100 ) % 100;$year = intval ( $cal_date / 10000 );$time = $row[2]; if ($time >= 0 ) $duration =$row[5]; else { $duration = '';$hour = -1; } // Check for repeating event info... // but not if we're overriding a single entry of an already repeating event... // confusing, eh? if ( ! empty ( $override ) ) {$rpt_end = 0; $rpt_end_date =$cal_date; $rpt_freq = 1;$rpt_type = 'none'; } else { $res = dbi_execute ( 'SELECT cal_id, cal_type, cal_end, cal_endtime, cal_frequency, cal_byday, cal_bymonth, cal_bymonthday, cal_bysetpos, cal_byweekno, cal_byyearday, cal_wkst, cal_count FROM webcal_entry_repeats WHERE cal_id = ?', array ($id ) ); if ( $res ) { if ($row = dbi_fetch_row ( $res ) ) {$rpt_type = $row[1];$rpt_end = ( $row[2] > 0 ? date_to_epoch ($row[2] . $row[3] ) : 0 ); if ( empty ($row[2] ) ) { $rpt_end_date =$cal_date; $rpt_end_time =$cal_time; } else { $rpt_endTS = date_to_epoch ($row[2] . $row[3] );$rpt_end_date = date ( 'Ymd', $rpt_endTS );$rpt_end_time = date ( 'His', $rpt_endTS ); }$rpt_freq = $row[4]; if ( ! empty ($row[5] ) ) $byday = explode ( ',',$row[5] ); $bydayStr =$row[5]; if ( ! empty ( $row[6] ) )$bymonth = explode ( ',', $row[6] ); if ( ! empty ($row[7] ) ) $bymonthday = explode ( ',',$row[7] ); $bymonthdayStr =$row[7]; if ( ! empty ( $row[8] ) )$bysetpos = explode ( ',', $row[8] );$bysetposStr = $row[8];$byweekno = $row[9];$byyearday = $row[10];$wkst = $row[11];$rpt_count = $row[12]; // Check to see if Weekends Only is applicable.$weekdays_only = ( $rpt_type == 'daily' &&$byday == 'MO,TU,WE,TH,FR' ); } dbi_free_result ( $res ); } }$res = dbi_execute ( 'SELECT cal_login, cal_percent, cal_status FROM webcal_entry_user WHERE cal_id = ?', array ( $id ) ); if ($res ) { while ( $row = dbi_fetch_row ($res ) ) { $overall_percent[] =$row; if ( $login ==$row[0] || ( $is_admin &&$user == $row[0] ) ) {$task_percent = $row[1];$task_status = $row[2]; } } dbi_free_result ($res ); } // Determine if Expert mode needs to be set. $expert_mode = ( count ($byday ) || count ( $bymonth ) || count ($bymonthday ) || count ( $bysetpos ) || isset ($byweekno ) || isset ( $byyearday ) || isset ($rpt_count ) ); // Get Repeat Exceptions. $res = dbi_execute ( 'SELECT cal_date, cal_exdate FROM webcal_entry_repeats_not WHERE cal_id = ?', array ($id ) ); if ( $res ) { while ($row = dbi_fetch_row ( $res ) ) { if ($row[1] == 1 ) $exceptions[] =$row[0]; else $inclusions[] =$row[0]; } dbi_free_result ( $res ); } } if ($CATEGORIES_ENABLED == 'Y' ) { $catById = get_categories_by_id ($id, $real_user, true ); if ( ! empty ($catById ) ) { $catNames = implode ( ', ',$catById ); $catList = implode ( ',', array_keys ($catById ) ); } } //end CATEGORIES_ENABLED test // Get reminders. $reminder = getReminders ($id ); $reminder_offset = ( empty ($reminder ) ? 0 : $reminder['offset'] );$rem_status = ( count ( $reminder ));$rem_use_date = ( ! empty ( $reminder['date'] ) ); // Get participants.$res = dbi_execute ( 'SELECT cal_login, cal_status FROM webcal_entry_user WHERE cal_id = ? AND cal_status IN ( \'A\', \'W\' )', array ( $id ) ); if ($res ) { while ( $row = dbi_fetch_row ($res ) ) { $participants[$row[0]] = 1; $selectedStatus[$row[0]] = $row[1]; } dbi_free_result ($res ); } // Not allowed for tasks or journals. if ( $eType == 'event' && ! empty ($ALLOW_EXTERNAL_USERS ) && $ALLOW_EXTERNAL_USERS == 'Y' )$external_users = event_get_external_users ( $id ); } else { // ########## New entry ################$id = 0; // To avoid warnings below about use of undefined var. // We'll use $WORK_DAY_START_HOUR and$WORK_DAY_END_HOUR // as our starting and due times. $cal_time =$WORK_DAY_START_HOUR . '0000'; $completed = '';$due_hour = $WORK_DAY_END_HOUR;$due_minute = $task_percent = 0;$due_time = $WORK_DAY_END_HOUR . '0000';$overall_percent = array (); // Get category if passed in URL as cat_id. $cat_id = getValue ( 'cat_id', '-?[0-9,\-]*', true ); if ( ! empty ($cat_id ) ) { $res = dbi_execute ( 'SELECT cat_name FROM webcal_categories WHERE cat_id = ? AND ( cat_owner = ? OR cat_owner IS NULL )', array ($cat_id, $real_user ) ); if ($res ) { $row = dbi_fetch_row ($res ); $catNames =$row[0]; $catList =$cat_id; } } // Reminder settings. $reminder_offset = ($REMINDER_WITH_DATE == 'N' ? $REMINDER_OFFSET : 0 );$rem_status = ( $REMINDER_DEFAULT == 'Y' );$rem_use_date = ( $reminder_offset == 0 &&$REMINDER_WITH_DATE == 'Y' ); if ( $eType == 'task' )$hour = $WORK_DAY_START_HOUR; // Anything other then testing for strlen breaks either hour=0 or no hour in URL. if ( strlen ($hour ) ) $time =$hour * 100; else $hour =$time = -1; if ( ! empty ( $defusers ) ) {$tmp_ar = explode ( ',', $defusers ); for ($i = 0, $cnt = count ($tmp_ar ); $i <$cnt; $i++ ) {$participants[$tmp_ar[$i]] = 1; } } //Add the logged in user if none other supplied if ( count ( $participants ) == 0 )$participants[$login] = 1; if ($readonly == 'N' ) { // Is public allowed to add events? if ( $login == '__public__' &&$PUBLIC_ACCESS_CAN_ADD != 'Y' ) $can_edit = false; else$can_edit = true; } } $dateYmd = date ( 'Ymd' );$thisday = $day;$thismonth = $month;$thisyear = $year; if ( empty ($rpt_type ) || ! $rpt_type )$rpt_type = 'none'; // Avoid error for using undefined vars. if ( ! isset ( $hour ) &&$hour != 0 ) $hour = -1; else if ( isset ($hour ) && $hour >= 0 )$cal_time = ( $hour * 10000 ) + ( isset ($minute ) ? $minute * 100 : 0 ); if ( empty ($access ) ) $access = ''; if ( empty ($cal_url ) ) $cal_url = ''; if ( empty ($description ) || $description == ' ' )$description = ''; if ( empty ( $duration ) )$duration = 0; if ( $duration == 1440 &&$time == 0 ) { $duration =$hour = $minute = '';$allday = 'Y'; } else $allday = 'N'; if ( empty ($location ) ) $location = ''; if ( empty ($name ) ) $name = ''; if ( empty ($priority ) ) $priority = 5; if ( empty ($rpt_end_date ) ) $rpt_end_date = 0; if ( empty ($rpt_end_time ) ) $rpt_end_time = 0; if ( empty ($rpt_freq ) ) $rpt_freq = 0; if ( empty ($cal_date ) ) { $cal_date = ( ! empty ($date ) && $eType != 'task' ?$date : $dateYmd ); if ( empty ($due_date ) ) $due_date =$dateYmd; } if ( empty ( $thisyear ) )$thisdate = $dateYmd; else {$thisdate = sprintf ( "%04d%02d%02d", $thisyear, empty ($thismonth ) ? date ( 'm' ) : $thismonth, empty ($thisday ) ? date ( 'd' ) : $thisday ); } if ( empty ($cal_date ) || ! $cal_date )$cal_date = $thisdate; if ( empty ($due_date ) || ! $due_date )$due_date = $thisdate; // Setup to display user's timezone difference if Admin or Assistant. // Even though event is stored in GMT, // an Assistant may need to know that the boss is in a different Timezone. if ($is_assistant || $is_admin && ! empty ($user ) ) { $tz_offset = date ( 'Z', date_to_epoch ($cal_date . $cal_time ) );$user_TIMEZONE = get_pref_setting ( $user, 'TIMEZONE' ); set_env ( 'TZ',$user_TIMEZONE ); $user_tz_offset = date ( 'Z', date_to_epoch ($cal_date . $cal_time ) ); if ($tz_offset != $user_tz_offset ) { // Different TZ_Offset. user_load_variables ($user, 'temp' ); $tz_diff = ($user_tz_offset - $tz_offset ) / 3600;$abs_diff = abs ( $tz_diff ); // translate ( 'is in a different timezone than you are. Currently' ) // translate ( 'hour ahead of you' ) translate ( 'hour behind you' ) // translate ( 'hours ahead of you' ) translate ( 'hours behind you' ) // translate ( 'XXX is in a different timezone (ahead)' ) // translate ( 'XXX is in a different timezone (behind)' ) // Line breaks in translates below are to bypass update_translation.pl.$TZ_notice = str_replace ( 'XXX', array ( $tempfullname, // TODO show hh:mm instead of abs.$abs_diff . ' ' . translate ( 'hour' . ( $abs_diff == 1 ? '' : 's' ) ), translate ( 'Time entered here is based on your Timezone.' ) ), translate ( 'XXX is in a different timezone (' . ($tz_diff > 0 ? 'ahead)' : 'behind)' ) ) ); } // Return to $login TIMEZONE. set_env ( 'TZ',$TIMEZONE ); } $eType_label = ' ( ' . translate ($eType ) . ' )'; echo '

' . ( $id ? translate ( 'Edit Entry' ) : translate ( 'Add Entry' ) ) .$eType_label . '

'; if ( $can_edit ) {$tabs_ar = array ( 'details', translate ( 'Details' ) ); if ( $DISABLE_PARTICIPANTS_FIELD != 'Y' ) {$tabs_ar[] = 'participants'; $tabs_ar[] = translate ( 'Participants' ); } if ($DISABLE_REPEATING_FIELD != 'Y' ) { $tabs_ar[] = 'pete';$tabs_ar[] = translate ( 'Repeat' ); } if ( $DISABLE_REMINDER_FIELD != 'Y' ) {$tabs_ar[] = 'reminder'; $tabs_ar[] = translate ( 'Reminders' ); }$tabs = ''; for ( $i = 0,$cnt = count ( $tabs_ar );$i < $cnt;$i++ ) { $tabs .= ' ' .$tabs_ar[++$i] . ''; } echo ' ' . ( ! empty ($id ) && ( empty ( $copy ) ||$copy != '1' ) ? ' ' : '' ) /* We need an additional hidden input field. */ . ' ' // Are we overriding an entry from a repeating event... . ( empty ( $override ) ? '' : ' ' ) // If assistant, need to remember boss = user. . ($is_assistant || $is_nonuser_admin || ! empty ($user ) ? ' ' : '' ) // If has cal_group_id was set, need to set parent = $parent. . ( empty ($parent ) ? '' : ' ' ) . ' ' . ( $useTabs ? ' ' .$tabs . '
' : '' ) . ' ' . ( $useTabs ? ' ' : ' ' . translate ( 'Details' ) . '' ) . ' ' . ( ! empty ($categories ) || $DISABLE_ACCESS_FIELD != 'Y' || ($DISABLE_PRIORITY_FIELD != 'Y' ) /* New table for extra fields. */ ? ' ' : '' ) . ( $DISABLE_ACCESS_FIELD != 'Y' ? ' ' : '' ); if ($DISABLE_PRIORITY_FIELD != 'Y' ) { echo ' '; } echo ( ! empty ( $categories ) &&$CATEGORIES_ENABLED == 'Y' ? ' ' : '' ) . ( ! empty ( $categories ) ||$DISABLE_ACCESS_FIELD != 'Y' || ( $DISABLE_PRIORITY_FIELD != 'Y' ) ? ' ' : '' ); if ($eType == 'task' ) { // Only for tasks. $completed_visible = ( strlen ($completed ) ? 'visible' : 'hidden' ); echo '
'; if ( ! empty ( $overall_percent ) ) { echo ' ' . date_selection ( 'completed_',$completed ) . '
'; $others_complete = 'yes'; for ($i = 0, $cnt = count ($overall_percent ); $i <$cnt; $i++ ) { user_load_variables ($overall_percent[$i][0], 'percent' ); echo ' '; if ($overall_percent[$i][0] !=$real_user && $overall_percent[$i][1] < 100 ) $others_complete = 'no'; } echo ' ' . translate ( 'All Percentages' ) . ' ' .$percentfullname . ' ' . $overall_percent[$i][1] . '
'; } echo '
'; } //end tasks only echo '
' . date_selection ( '', $cal_date ) . ' ' .$TZ_notice . '
' . time_selection ( 'entry_', $cal_time ) . ' ' . date_selection ( 'due_',$due_date ) . '
' . time_selection ( 'due_', $due_time ) . ' ' . ($use_fckeditor || $use_htmlarea ? ' ' . ($DISABLE_LOCATION_FIELD != 'Y' ? ' ' : '' ) . ( $DISABLE_URL_FIELD != 'Y' ? ' ' : '' ) . ' ' . ( empty ($TZ_notice ) ? '' : ' ' ) . ' '; } else echo ' '; } else { // eType == task echo ' class="tooltip" title="' . tooltip ( 'time-help' ) . '">' . translate ( 'Start Time' ) . ':'; } // Site-specific extra fields (see site_extras.php). // load and display any site-specific fields. if ( $id > 0 )$extras = get_site_extra_fields ( $id );$site_extracnt = count ( $site_extras ); echo ' ' . ($site_extracnt ? ( ! empty ( $site_extras[0]['FIELDSET'] ) ? ' ' . translate ( 'Site Extras' ) . '' : '' ) . ' ' : '' ); for ($i = 0; $i <$site_extracnt; $i++ ) { if ($site_extras[$i] == 'FIELDSET' ) continue;$extra_name = $site_extras[$i][0]; $extra_descr =$site_extras[$i][1];$extra_type = $site_extras[$i][2]; $extra_arg1 =$site_extras[$i][3];$extra_arg2 = $site_extras[$i][4]; // Default value if needed. $defIdx = ( empty ($extras[$extra_name]['cal_data'] ) ?$extra_arg2 : $extras[$extra_name]['cal_data'] ); echo '
' . ( $extra_type == EXTRA_MULTILINETEXT ? ' ' : '' ) . translate ($extra_descr ) . ':
'; if ( $extra_type == EXTRA_URL ) echo ' '; elseif ($extra_type == EXTRA_EMAIL ) echo ' '; elseif ( $extra_type == EXTRA_DATE ) echo date_selection ($extra_name, ( empty ( $extras[$extra_name]['cal_date'] ) ? $cal_date :$extras[$extra_name]['cal_date'] ) ); elseif ($extra_type == EXTRA_TEXT ) { $size = ($extra_arg1 > 0 ? $extra_arg1 : 50 ); echo ' '; } elseif ($extra_type == EXTRA_MULTILINETEXT ) echo ' '; elseif ( $extra_type == EXTRA_USER ) { // Show list of calendar users... echo ' '; } elseif ($extra_type == EXTRA_SELECTLIST ) { // Show custom select list. $extraSelectArr =$isMultiple = $multiselect = ''; if ( is_array ($extra_arg1 ) ) { $extra_arg1cnt = count ($extra_arg1 ); if ( $extra_arg2 > 0 ) {$multiselect = ' multiple="multiple" size="' . min ( $extra_arg2,$extra_arg1cnt ) . '" '; $isMultiple = '[]'; if ( ! empty ($extras ) ) $extraSelectArr = explode ( ',',$extras[$extra_name]['cal_data'] ); } echo ' '; } elseif ($extra_type == EXTRA_RADIO ) // Show custom radio selections. echo print_radio ( $extra_name,$extra_arg1, '', $defIdx ); elseif ($extra_type == EXTRA_CHECKBOX ) // Show custom checkbox option. echo print_checkbox ( array ( $extra_name,$extra_arg1, '', $defIdx ) ); echo ' '; } if ($site_extracnt ) { echo ' ' . ( empty ( $site_extras[0]['FIELDSET'] ) ? '' : ' ' ); } // end site-specific extra fields echo ($useTabs ? ' ' : ' ' ) . ' ' . ( $useTabs ? ' ' : ' ' . translate ( 'Participants' ) . '' ) . ' '; // . // Only ask for participants if we are multi-user.$show_participants = ( $DISABLE_PARTICIPANTS_FIELD != 'Y' ); if ($is_admin ) $show_participants = true; if ($login == '__public__' && $PUBLIC_ACCESS_OTHERS != 'Y' )$show_participants = false; if ( $single_user == 'N' &&$show_participants ) { $userlist = get_my_users ($create_by, 'invite' ); if ( $NONUSER_ENABLED == 'Y' ) { // Include public NUCs.$nonusers = get_my_nonusers ( $real_user, false );$userlist = ( $NONUSER_AT_TOP == 'Y' ? array_merge ($nonusers, $userlist ) : array_merge ($userlist, $nonusers ) ); }$num_users = $size = 0;$usercnt = count ( $userlist );$users = ''; for ( $i = 0;$i < $usercnt;$i++ ) { $l =$userlist[$i]['cal_login'];$size++; $users .= ' '; } if ($size > 50 ) $size = 50; elseif ($size > 20 ) $size = 20; elseif ($size > 5 ) $size = 5; echo ' ' . ($GROUPS_ENABLED == 'Y' ? ' ' : '' ) . '
' // External users. . ( ! empty ( $ALLOW_EXTERNAL_USERS ) &&$ALLOW_EXTERNAL_USERS == 'Y' ? ' ' : '' ); } echo ' ' . ( $useTabs ? ' ' : ' ' ) . ' '; if ($DISABLE_REPEATING_FIELD != 'Y' ) { echo ( $useTabs ? ' ' : ' ' . translate ( 'Repeat' ) . '' ) . ' ' . date_selection ( 'except_',$rpt_end_date ? $rpt_end_date :$cal_date ) . '

' . ( $useTabs ? ' ' : ' ' ); } echo ' '; if ($DISABLE_REMINDER_FIELD != 'Y' ) { $rem_minutes =$reminder_offset; // Will be specified in total minutes. $rem_days = intval ($rem_minutes / 1440 ); $rem_minutes -= ($rem_days * 1440 ); $rem_hours = intval ($rem_minutes / 60 ); $rem_minutes -= ($rem_hours * 60 ); $rem_before = ( empty ($reminder['before'] ) || $reminder['before'] == 'Y' );$rem_related = ( empty ( $reminder['related'] ) ||$reminder['related'] == 'S' ); // Reminder Repeats. $rem_rep_count = ( isset ($reminder['repeats'] ) ? $reminder['repeats'] : 0 );$rem_rep_minutes = ( isset ( $reminder['duration'] ) ?$reminder['duration'] : 0 ); // Will be specified in total minutes. $rem_rep_days = intval ($rem_rep_minutes / 1440 ); $rem_rep_minutes -= ($rem_rep_days * 1440 ); $rem_rep_hours = intval ($rem_rep_minutes / 60 ); $rem_rep_minutes -= ($rem_rep_hours * 60 ); echo ( $useTabs ? ' ' : ' ' . translate ( 'Reminders' ) . '' ) . ' ' . date_selection ( 'reminder_', ( empty ($reminder['date'] ) ? $cal_date :$reminder['date'] ) ) . '
' . time_selection ( 'reminder_', ( empty ( $reminder['time'] ) ?$cal_time : $reminder['time'] ) ) . ' ' . ($useTabs ? ' ' : ' ' ); } if ( file_exists ( 'includes/classes/captcha/captcha.php' ) && $login == '__public__' && ! empty ($ENABLE_CAPTCHA ) && $ENABLE_CAPTCHA == 'Y' ) { if ( function_exists ( 'imagecreatetruecolor' ) ) { include_once 'includes/classes/captcha/captcha.php'; echo captcha::form (); } else etranslate ( 'CAPTCHA Warning' ); } echo ' '; echo ' ' // This bit should be moved to a webcal_fckconfig.js file. // Then the current FCKEditor SVN version would probably work. . ($use_fckeditor ? ' ' : '' ) . ' '; if ( $id > 0 && ($login == $create_by ||$single_user == 'Y' || $is_admin ) ) echo ' ' . translate ( 'Delete entry' ) . ' '; } else // translate ( 'You are not authorized to edit this entry.' ) echo str_replace ( 'XXX', translate ( 'entry' ), translate ( 'You are not authorized to edit this XXX.' ) ); // end if ($can_edit ) ob_end_flush (); echo print_trailer (); ?> 

     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207  ' ? $name :$description ); // For public events, we don't EVER allow HTML tags. There is just too // many bad things a malicious user can do. // See this for an example of how someone could create an admin account in // webcalendar: // https://www.upsploit.com/index.php/advisories/download/UPS-2010-0011 // This same technique could be used to delete all events and other bad stuff. if ( $login == '__public__' ) {$name = strip_tags ( $name );$description = strip_tags ( $description );$location = strip_tags ( $location ); } // Don't allow certain HTML tags in name, description and location. // Malicious users can use meta refresh to redirect users to another // site (possibly a malware site). This could be form a public submission // on an event calendar, and the admin gets sent to the malware site when // viewing the event to approve/reject it.$bannedTags = array ( 'HTML', 'HEAD', 'TITLE', 'BODY', 'SCRIPT', 'META', 'LINK', 'OBJECT', 'APPLET' ); foreach (array($name,$description, $location) as$chkfld) { for ( $i = 0;$i < count ( $bannedTags );$i++ ) { if ( preg_match ( "/<\s*$bannedTags[$i]/i", $chkfld ) ) {$error = translate('Security violation!'); break 2; } } } // Pass all numeric values through getPostValue. $entry_ampm = getPostValue ( 'entry_ampm' );$entry_hour = getPostValue ( 'entry_hour' ); $entry_minute = getPostValue ( 'entry_minute' );$end_ampm = getPostValue ( 'end_ampm' ); $end_hour = getPostValue ( 'end_hour' );$end_minute = getPostValue ( 'end_minute' ); $day = getPostValue ( 'day' );$month = getPostValue ( 'month' ); $year = getPostValue ( 'year' ); // Ensure variables are not empty. if ( empty ($eType ) ) $eType = 'event';$percent = getPostValue ( 'percent' ); if ( empty ( $percent ) )$percent = 0; if ( empty ( $timetype ) )$timetype = 'T'; $duration_h = getValue ( 'duration_h' );$duration_m = getValue ( 'duration_m' ); if ( empty ( $duration_h ) ||$duration_h < 0 ) $duration_h = 0; if ( empty ($duration_m ) || $duration_m < 0 )$duration_m = 0; // Reminder values could be valid as 0 if ( empty ( $rem_days ) )$rem_days = 0; if ( empty ( $rem_hours ) )$rem_hours = 0; if ( empty ( $rem_minutes ) )$rem_minutes = 0; if ( empty ( $rem_rep_days ) )$rem_rep_days = 0; if ( empty ( $rem_rep_hours ) )$rem_rep_hours = 0; if ( empty ( $rem_rep_minutes ) )$rem_rep_minutes = 0; if ( empty ( $reminder_hour ) )$reminder_hour = 0; if ( empty ( $reminder_minute ) )$reminder_minute = 0; // Timed event. if ( $timetype == 'T' ) {$entry_hour += $entry_ampm; if ($eType == 'task' ) $due_hour +=$due_ampm; } // Use end times if ( $TIMED_EVT_LEN == 'E' &&$eType != 'task' ) $end_hour +=$end_ampm; else $end_hour =$end_minute = 0; // If "all day event" was selected, then we set the event time to be 12AM with a // duration of 24 hours. We don't actually store the "all day event" flag per se. // This method makes conflict checking much simpler. We just need to make sure // that we don't screw up the day view (which normally starts with the first // timed event). Note that if someone actually wants to create an event that // starts at midnight and lasts exactly 24 hours, it will be treated in the // same manner. // All Day Event. if ( $timetype == 'A' )$duration_h = 24; // Untimed Event if ( $timetype == 'U' )$duration_h = 0; if ( strpos ( 'AU', $timetype ) !== false )$duration_m = $end_hour =$end_minute = $entry_hour =$entry_minute = 0; // Combine all values to create event start date/time. $eventstart = ($timetype != 'T' ? gmmktime ( $entry_hour,$entry_minute, 0, $month,$day, $year ) : mktime ($entry_hour, $entry_minute, 0,$month, $day,$year ) ); if ( $eType == 'task' ) { // Combine all values to create event due date/time - User Time.$eventdue = mktime ( $due_hour,$due_minute, 0, $due_month,$due_day, $due_year ); // Combine all values to create completed date if ( ! empty ($completed_year ) && ! empty ( $completed_month ) && ! empty ($completed_day ) ) $eventcomplete = sprintf ( "%04d%02d%02d",$completed_year, $completed_month,$completed_day ); } // Create event stop from event duration/end values. // Note: for any given event, either end times or durations are 0 if ( $TIMED_EVT_LEN == 'E' ) { //User might have entered midnight as an end time //if so, we need to jump to next day if ($end_hour === 0 && $end_ampm == 0 )$day++; $eventstophour =$end_hour + $duration_h;$eventstopmin = $end_minute +$duration_m; } else { $eventstophour =$entry_hour + $duration_h;$eventstopmin = $entry_minute +$duration_m; } $duration = 0; if ($eType != 'task' ) { $eventstop = ($timetype != 'T' ? gmmktime ( $eventstophour,$eventstopmin, 0, $month,$day, $year ) : mktime ($eventstophour, $eventstopmin, 0,$month, $day,$year ) ); // Calculate event duration. if ( $timetype == 'A' )$duration = 1440; elseif ( $timetype == 'T' ) {$duration = ( $eventstop -$eventstart ) / 60; if ( $duration < 0 )$duration = 0; } } // Make sure this user is really allowed to edit this event. // Otherwise, someone could hand type in the URL to edit someone else's event. // Can edit if: // - new event // - user is admin // - user created event // - user is participant $can_doall =$can_edit = false; // Value may be needed later for recreating event. $user = getPostValue ( 'user' );$old_create_by = ( empty ( $user ) ? '' :$user ); if ( empty ( $id ) ) // New event...$can_edit = true; else { // Event owner or assistant? $res = dbi_execute ( 'SELECT cal_create_by FROM webcal_entry WHERE cal_id = ?', array ($id ) ); if ( $res ) {$row = dbi_fetch_row ( $res ); // Value may be needed later for recreating event.$old_create_by = $row[0]; if ( ($row[0] == $login ) || ( ($user == $row[0] ) && ($is_assistant || $is_nonuser_admin ) ) )$can_edit = true; dbi_free_result ( $res ); } else$error = $dberror . dbi_error (); } if ($is_admin ) $can_edit = true; else if ( access_is_enabled () && ! empty ($old_create_by ) ) $can_edit = access_user_calendar ( 'edit',$old_create_by, $login ); if ( empty ($error ) && ! $can_edit ) { // Is user a participant of that event?$res = dbi_execute ( 'SELECT cal_id FROM webcal_entry_user WHERE cal_id = ? AND cal_login = ? AND cal_status IN ( \'W\',\'A\' )', array ( $id,$login ) ); if ( $res ) {$row = dbi_fetch_row ( $res ); if ( ! empty ($row[0] ) ) $can_edit = true; // Is participant. dbi_free_result ($res ); } else $error =$dberror . dbi_error (); } if ( ! $can_edit && empty ($error ) ) $error = print_not_auth (6); // CAPTCHA if ( file_exists ( 'includes/classes/captcha/captcha.php' ) &&$login == '__public__' && ! empty ( $ENABLE_CAPTCHA ) &&$ENABLE_CAPTCHA == 'Y' ) { if ( function_exists ( 'imagecreatetruecolor' ) ) { include_once 'includes/classes/captcha/captcha.php'; $res = captcha::check (); if ( !$res ) $error = translate ( 'You must enter the anti-spam text on the previous page.' ); } else { // Should have seen warning on edit_entry.php, so no warning here... } } // If display of participants is disabled, set the participant list // to the event creator. This also works for single-user mode. // Basically, if no participants were selected (because there // was no selection list available in the form or because the user // refused to select any participant from the list), then we will // assume the only participant is the current user. if ( empty ($participants[0] ) ) { $participants[0] =$login; // There might be a better way to do this, // but if Admin sets this value, WebCalendar should respect it. if ( ! empty ( $PUBLIC_ACCESS_DEFAULT_SELECTED ) &&$PUBLIC_ACCESS_DEFAULT_SELECTED == 'Y' ) $participants[1] = '__public__'; } if ( empty ($DISABLE_REPEATING_FIELD ) || $DISABLE_REPEATING_FIELD == 'N' ) { // Process only if Expert Mode or Weekly. if ($rpt_type == 'weekly' || ! empty ( $rptmode ) ) {$bydayAr = explode ( ',', $bydayList ); if ( ! empty ($bydayAr ) ) { foreach ( $bydayAr as$bydayElement ) { if ( strlen ( $bydayElement ) > 2 )$bydayAll[] = $bydayElement; } } if ( ! empty ($bydayAll ) ) { $bydayAll = array_unique ($bydayAll ); // Call special sort algorithm. usort ( $bydayAll, 'sort_byday' );$byday = implode ( ',', $bydayAll ); // Strip off leading comma if present. if ( substr ($byday, 0, 1 ) == ',' ) $byday = substr ($byday, 1 ); } } // This allows users to select on weekdays if daily. if ( $rpt_type == 'daily' && ! empty ($weekdays_only ) ) $byday = 'MO,TU,WE,TH,FR'; // Process only if expert mode and MonthbyDate or Yearly. if ( ($rpt_type == 'monthlyByDate' || $rpt_type == 'yearly' ) && ! empty ($rptmode ) ) { $bymonthdayAr = explode ( ',',$bymonthdayList ); if ( ! empty ( $bymonthdayAr ) ) { sort ($bymonthdayAr ); $bymonthdayAr = array_unique ($bymonthdayAr ); $bymonthday = implode ( ',',$bymonthdayAr ); } // Strip off leading comma if present. if ( substr ( $bymonthday, 0, 1 ) == ',' )$bymonthday = substr ( $bymonthday, 1 ); } if ($rpt_type == 'monthlyBySetPos' ) { $bysetposAr = explode ( ',',$bysetposList ); if ( ! empty ( $bysetposAr ) ) { sort ($bysetposAr ); $bysetposAr = array_unique ($bysetposAr ); $bysetpos = implode ( ',',$bysetposAr ); } // Strip off leading comma if present. if ( substr ( $bysetpos, 0, 1 ) == ',' )$bysetpos = substr ( $bysetpos, 1 ); } // If expert mode not selected, // we need to set the basic value for monthlyByDay events. if ($rpt_type == 'monthlyByDay' && empty ( $rptmode ) && empty ($byday ) ) $byday = ceil ($day / 7 ) . $byday_names[ date ( 'w',$eventstart ) ]; $bymonth = ( empty ($bymonth ) ? '' : implode ( ',', $bymonth ) ); if ( ! empty ($rpt_year ) ) { $rpt_hour +=$rpt_ampm; $rpt_until = mktime ($rpt_hour, $rpt_minute, 0,$rpt_month, $rpt_day,$rpt_year ); } $exception_list =$inclusion_list = array (); if ( empty ( $exceptions ) )$exceptions = array (); else { foreach ( $exceptions as$exception ) { if ( substr ( $exception, 0, 1 ) == '+' )$inclusion_list[] = substr ( $exception, 1, 8 ); else$exception_list[] = substr ( $exception, 1, 8 ); } } } // end test for$DISABLE_REPEATING_FIELD // Make sure we initialize these variables. if ( empty ( $byday ) )$byday = ''; if ( empty ( $bymonth ) )$bymonth = ''; if ( empty ( $bymonthday ) )$bymonthday = ''; if ( empty ( $bysetpos ) )$bysetpos = ''; if ( empty ( $byweekno ) )$byweekno = ''; if ( empty ( $byyearday ) )$byyearday = ''; if ( empty ( $count ) )$count = ''; if ( empty ( $rpt_freq ) )$rpt_freq = 1; if ( empty ( $rpt_type ) )$rpt_type = ''; if ( empty ( $wkst ) )$wkst = 'MO'; // First check for any schedule conflicts. if ( empty ( $ALLOW_CONFLICT_OVERRIDE ) ||$ALLOW_CONFLICT_OVERRIDE != 'Y' ) $confirm_conflicts = ''; // Security precaution. if ($ALLOW_CONFLICTS != 'Y' && empty ( $confirm_conflicts ) && strlen ($entry_hour ) > 0 && $timetype != 'U' &&$eType != 'task' ) { $conf_until = ( empty ($rpt_until ) ? '' : $rpt_until );$conf_count = ( empty ( $count ) ? 999 :$count ); $dates = get_all_dates ($eventstart, $rpt_type,$rpt_freq, array ( $bymonth,$byweekno, $byyearday,$bymonthday, $byday,$bysetpos ), $conf_count,$conf_until, $wkst,$exception_list, $inclusion_list ); // Make sure at least start date is in array. if ( empty ($dates ) ) $dates[0] =$eventstart; // Make sure $thismonth and$thisyear are set for use in query_events (). $thismonth =$month; $thisyear =$year; $conflicts = check_for_conflicts ($dates, $duration,$eventstart, $participants,$login, empty ( $id ) ? 0 :$id ); } //end check for any schedule conflicts if ( empty ( $error ) && ! empty ($conflicts ) ) $error = translate ( 'The following conflicts with the suggested time' ) . ':$conflicts
'; $msg = ''; if ( empty ($error ) ) { $newevent = true; // Now add the entries. if ( empty ($id ) || $do_override ) {$res = dbi_execute ( 'SELECT MAX(cal_id) FROM webcal_entry' ); if ( $res ) {$row = dbi_fetch_row ( $res );$id = $row[0] + 1; dbi_free_result ($res ); } else $id = 1; } else {$newevent = false; // Save old values of participants. $res = dbi_execute ( 'SELECT cal_login, cal_status, cal_percent FROM webcal_entry_user WHERE cal_id = ? ', array ($id ) ); if ( $res ) { for ($i = 0; $tmprow = dbi_fetch_row ($res ); $i++ ) {$old_status[$tmprow[0]] =$tmprow[1]; $old_percent[$tmprow[0]] = $tmprow[2]; } dbi_free_result ($res ); } else $error =$dberror . dbi_error (); if ( empty ( $error ) ) { dbi_execute ( 'DELETE FROM webcal_entry WHERE cal_id = ?', array ($id ) ); dbi_execute ( 'DELETE FROM webcal_entry_ext_user WHERE cal_id = ?', array ( $id ) ); dbi_execute ( 'DELETE FROM webcal_entry_repeats WHERE cal_id = ?', array ($id ) ); dbi_execute ( 'DELETE FROM webcal_entry_user WHERE cal_id = ?', array ( $id ) ); dbi_execute ( 'DELETE FROM webcal_site_extras WHERE cal_id = ?', array ($id ) ); } $newevent = false; } if ($do_override ) { if ( ! dbi_execute ( 'INSERT INTO webcal_entry_repeats_not ( cal_id, cal_date, cal_exdate ) VALUES ( ?, ?, ? )', array ( $old_id,$override_date, 1 ) ) ) $error =$dberror . dbi_error (); } $query_params = array ();$query_params[] = $id; if ($old_id > 0 ) $query_params[] =$old_id; $query_params[] = ( empty ($old_create_by ) ? $login :$old_create_by ); $query_params[] = gmdate ( 'Ymd',$eventstart ); $query_params[] = ( ( strlen ($entry_hour ) > 0 && $timetype != 'U' ) ? gmdate ( 'His',$eventstart ) : '-1' ); if ( ! empty ( $eventcomplete ) )$query_params[] = $eventcomplete; // Just set$eventdue to something. $eventdue = ( empty ($eventdue ) ? $eventstart :$eventdue ); $query_params[] = gmdate ( 'Ymd',$eventdue ); $query_params[] = gmdate ( 'His',$eventdue ); $query_params[] = gmdate ( 'Ymd' );$query_params[] = gmdate ( 'Gis' ); $query_params[] = sprintf ( "%d",$duration ); $query_params[] = ( empty ($priority ) ? '5' : sprintf ( "%d", $priority ) );$query_params[] = ( empty ( $access ) ? 'P' :$access ); $tmpRpt = ( ! empty ($rpt_type ) && $rpt_type != 'none' ); if ($eType == 'event' ) $query_params[] = ($tmpRpt ? 'M' : 'E' ); elseif ( $eType == 'journal' )$query_params[] = ( $tmpRpt ? 'O' : 'J' ); elseif ($eType == 'task' ) $query_params[] = ($tmpRpt ? 'N' : 'T' ); $query_params[] = ( strlen ($name ) == 0 ? 'Unnamed Event' : $name );$query_params[] = $description; if ( ! empty ($location ) ) $query_params[] =$location; if ( ! empty ( $entry_url ) )$query_params[] = $entry_url; if ( empty ($error ) && ! dbi_execute ( 'INSERT INTO webcal_entry ( cal_id, ' . ( $old_id > 0 ? ' cal_group_id, ' : '' ) . 'cal_create_by, cal_date, cal_time, ' . ( empty ($eventcomplete ) ? '' : 'cal_completed, ' ) . 'cal_due_date, cal_due_time, cal_mod_date, cal_mod_time, cal_duration, ' . 'cal_priority, cal_access, cal_type, cal_name, cal_description ' . ( empty ( $location ) ? '' : ',cal_location ' ) . ( empty ($entry_url ) ? '' : ',cal_url ' ) . ' ) VALUES ( ?, ' . ( $old_id > 0 ? '?, ' : '' ) . '?, ?, ?, ' . ( empty ($eventcomplete ) ? '' : '?, ' ) . '?, ?, ?, ?, ?, ?, ?, ?, ?, ? ' . ( empty ( $location ) ? '' : ',? ' ) . ( empty ($entry_url ) ? '' : ',? ' ) . ')', $query_params ) ) {$error = $dberror . dbi_error (); } // Log add/update. if ($eType == 'task' ) { $log_c = LOG_CREATE_T;$log_u = LOG_UPDATE_T; } elseif ( $eType == 'journal' ) {$log_c = LOG_CREATE_J; $log_u = LOG_UPDATE_J; } else {$log_c = LOG_CREATE; $log_u = LOG_UPDATE; } activity_log ($id, $login, ($is_assistant || $is_nonuser_admin ?$user : $login ),$newevent ? $log_c :$log_u, '' ); if ( $single_user == 'Y' )$participants[0] = $single_user_login; // Add categories.$cat_owner = ( ( ! empty ( $user ) && strlen ($user ) ) && ( $is_assistant ||$is_admin ) ) ? $user :$login; dbi_execute ( 'DELETE FROM webcal_entry_categories WHERE cal_id = ? AND ( cat_owner = ? OR cat_owner IS NULL )', array ( $id,$cat_owner ) ); if ( ! empty ( $cat_id ) ) {$categories = explode ( ',', $cat_id );$categorycnt = count ( $categories ); for ($i = 0; $i <$categorycnt; $i++ ) {$names = $values = array ();$names[] = 'cal_id'; $values[] =$id; $names[] = 'cat_id';$values[] = abs ( $categories[$i] ); // We set cat_id negative in form if global. if ( $categories[$i] > 0 ) { $names[] = 'cat_owner';$values[] = $cat_owner;$names[] = 'cat_order'; $values[] = ($i + 1 ); } else { $names[] = 'cat_order';$values[] = 99; // Forces global categories to appear at the end of lists. } // Build the variable placeholders - comma-separated question marks. $placeholders = '';$valuecnt = count ( $values ); for ($v_i = 0; $v_i <$valuecnt; $v_i++ ) {$placeholders .= '?,'; } $placeholders = preg_replace ( '/,$/', '', $placeholders ); // Remove trailing ','. if ( ! dbi_execute ( 'INSERT INTO webcal_entry_categories ( ' . implode ( ', ',$names ) . ' ) VALUES ( ' . $placeholders . ' )',$values ) ) { $error =$dberror . dbi_error (); break; } } } // Add site extras. $site_extracnt = count ($site_extras ); $extra_email_data = ''; for ($i = 0; $i <$site_extracnt && empty ( $error );$i++ ) { if ( $site_extras[$i] == 'FIELDSET' ) continue; $extra_name =$site_extras[$i][0];$extra_type = $site_extras[$i][2]; $extra_arg1 =$site_extras[$i][3];$extra_arg2 = $site_extras[$i][4]; if ( ! empty ( $site_extras[$i][5] ) ) $extra_email =$site_extras[$i][5] & EXTRA_DISPLAY_EMAIL; //$value = extra_name; $value = getPostValue ($extra_name ); // echo "Looking for $extra_name... value = " .$value . " ... type = " . // $extra_type . " \n";$sql = ''; $query_params = array (); if ( strlen ($extra_name ) || $extra_type == EXTRA_DATE ) { if ($extra_type == EXTRA_URL || $extra_type == EXTRA_EMAIL ||$extra_type == EXTRA_TEXT || $extra_type == EXTRA_USER ||$extra_type == EXTRA_MULTILINETEXT || $extra_type == EXTRA_SELECTLIST ||$extra_type == EXTRA_RADIO || $extra_type == EXTRA_CHECKBOX ) { // We were passed an array instead of a string. if ($extra_type == EXTRA_SELECTLIST && $extra_arg2 > 0 )$value = implode ( ',', $value );$sql = 'INSERT INTO webcal_site_extras ( cal_id, cal_name, cal_type, cal_data ) VALUES ( ?, ?, ?, ? )'; $query_params = array ($id, $extra_name,$extra_type, $value ); if ( ! empty ($extra_email ) ) { $value = ($extra_type == EXTRA_RADIO ? $extra_arg1[$value] : $value );$extra_email_data .= $extra_name . ': ' .$value . "\n"; } } else if ( $extra_type == EXTRA_DATE ) {$dname = getPostValue ( $extra_name . 'day' );$mname = getPostValue ( $extra_name . 'month' );$yname = getPostValue ( $extra_name . 'year' );$edate = sprintf ( "%04d%02d%02d", $yname,$mname, $dname );$sql = 'INSERT INTO webcal_site_extras ( cal_id, cal_name, cal_type, cal_date ) VALUES ( ?, ?, ?, ? )'; $query_params = array ($id, $extra_name,$extra_type, $edate ); if ( ! empty ($extra_email ) ) $extra_email_data .=$extra_name . ': ' . $edate . "\n"; } } if ( strlen ($sql ) && empty ( $error ) ) { if ( ! dbi_execute ($sql, $query_params ) )$error = $dberror . dbi_error (); } } //end for site_extras loop // Process reminder. if ( ! dbi_execute ( 'DELETE FROM webcal_reminders WHERE cal_id = ?', array ($id ) ) ) $error =$dberror . dbi_error (); if ( $DISABLE_REMINDER_FIELD != 'Y' &&$reminder == true ) { if ( empty ( $rem_before ) )$rem_before = 'Y'; if ( empty ( $rem_last_sent ) )$rem_last_sent = '0'; if ( empty ( $rem_related ) )$rem_related = 'S'; $reminder_date =$reminder_duration = $reminder_offset =$reminder_repeats = 0; if ( $rem_when == 'Y' ) { // Use date.$reminder_hour += $reminder_ampm;$reminder_date = mktime ( $reminder_hour,$reminder_minute, 0, $reminder_month,$reminder_day, $reminder_year ); } else // Use offset.$reminder_offset = ( $rem_days * 1440 ) + ($rem_hours * 60 ) + $rem_minutes; if ($rem_rep_count > 0 ) { $reminder_repeats =$rem_rep_count; $reminder_duration = ($rem_rep_days * 1440 ) + ( $rem_rep_hours * 60 ) +$rem_rep_minutes; } if ( ! dbi_execute ( 'INSERT INTO webcal_reminders ( cal_id, cal_date, cal_offset, cal_related, cal_before, cal_repeats, cal_duration, cal_action, cal_last_sent, cal_times_sent ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )', array ( $id,$reminder_date, $reminder_offset,$rem_related, $rem_before,$reminder_repeats, $reminder_duration,$rem_action, $rem_last_sent,$rem_times_sent ) ) ) $error =$dberror . dbi_error (); } // Clearly, we want to delete the old repeats, before inserting new... if ( empty ( $error ) ) { if ( ! dbi_execute ( 'DELETE FROM webcal_entry_repeats WHERE cal_id = ?', array ($id ) ) ) $error =$dberror . dbi_error (); if ( ! dbi_execute ( 'DELETE FROM webcal_entry_repeats_not WHERE cal_id = ?', array ( $id ) ) )$error = $dberror . dbi_error (); // Add repeating info. if ( ! empty ($rpt_type ) && strlen ( $rpt_type ) &&$rpt_type != 'none' ) { $freq = ($rpt_freq ? $rpt_freq : 1 );$names = $values = array ();$names[] = 'cal_id'; $values[] =$id; $names[] = 'cal_type';$values[] = $rpt_type;$names[] = 'cal_frequency'; $values[] =$freq; if ( ! empty ( $bymonth ) ) {$names[] = 'cal_bymonth'; $values[] =$bymonth; } if ( ! empty ( $bymonthday ) ) {$names[] = 'cal_bymonthday'; $values[] =$bymonthday; } if ( ! empty ( $byday ) ) {$names[] = 'cal_byday'; $values[] =$byday; } if ( ! empty ( $bysetpos ) ) {$names[] = 'cal_bysetpos'; $values[] =$bysetpos; } if ( ! empty ( $byweekno ) ) {$names[] = 'cal_byweekno'; $values[] =$byweekno; } if ( ! empty ( $byyearday ) ) {$names[] = 'cal_byyearday'; $values[] =$byyearday; } if ( ! empty ( $wkst ) ) {$names[] = 'cal_wkst'; $values[] =$wkst; } if ( ! empty ( $rpt_count ) && is_numeric ($rpt_count ) ) { $names[] = 'cal_count';$values[] = $rpt_count; } if ( ! empty ($rpt_until ) ) { $names[] = 'cal_end';$values[] = gmdate ( 'Ymd', $rpt_until );$names[] = 'cal_endtime'; $values[] = gmdate ( 'His',$rpt_until ); } $placeholders = '';$valuecnt = count ( $values ); for ($v_i = 0; $v_i <$valuecnt; $v_i++ ) {$placeholders .= '?,'; } $placeholders = preg_replace ( '/,$/', '', $placeholders ); // Remove trailing ','.$sql = 'INSERT INTO webcal_entry_repeats ( ' . implode ( ', ', $names ) . ' ) VALUES ( ' .$placeholders . ' )'; dbi_execute ( $sql,$values ); $msg .= 'SQL: ' .$sql . '

'; } //end add repeating info // We manually created exceptions. This can be done without repeats. if ( ! empty ( $exceptions ) ) {$exceptcnt = count ( $exceptions ); for ($i = 0; $i <$exceptcnt; $i++ ) { if ( ! dbi_execute ( 'INSERT INTO webcal_entry_repeats_not ( cal_id, cal_date, cal_exdate ) VALUES ( ?, ?, ? )', array ($id, substr ( $exceptions[$i], 1, 8 ), ( ( substr ( $exceptions[$i], 0, 1 ) == '+' ) ? 0 : 1 ) ) ) ) $error =$dberror . dbi_error (); } } //end exceptions } // EMAIL PROCESSING $partcnt = count ($participants ); $from =$login_email; if ( empty ( $from ) && ! empty ($EMAIL_FALLBACK_FROM ) ) $from =$EMAIL_FALLBACK_FROM; // Check if participants have been removed and send out emails. if ( ! $newevent && count ($old_status ) > 0 ) { while ( list ( $old_participant,$dummy ) = each ( $old_status ) ) {$found_flag = false; for ( $i = 0;$i < $partcnt;$i++ ) { if ( $participants[$i] == $old_participant ) {$found_flag = true; break; } } // Check UAC. $can_email = 'Y'; if ( access_is_enabled () )$can_email = access_user_calendar ( 'email', $old_participant,$login ); $is_nonuser_admin = user_is_nonuser_admin ($login, $old_participant ); // Don't send mail if we are editing a non-user calendar and we are the admin. if ( !$found_flag && !$is_nonuser_admin &&$can_email == 'Y' ) { // Only send mail if their email address is filled in. $do_send = get_pref_setting ($old_participant, 'EMAIL_EVENT_DELETED' ); $htmlmail = get_pref_setting ($old_participant, 'EMAIL_HTML' ); $t_format = get_pref_setting ($old_participant, 'TIME_FORMAT' ); $user_TIMEZONE = get_pref_setting ($old_participant, 'TIMEZONE' ); set_env ( 'TZ', $user_TIMEZONE );$user_language = get_pref_setting ( $old_participant, 'LANGUAGE' ); user_load_variables ($old_participant, 'temp' ); if ( $old_participant !=$login && ! empty ( $tempemail ) &&$do_send == 'Y' && $SEND_EMAIL != 'N' ) { reset_language ( empty ($user_language ) || ( $user_language == 'none' ) ?$LANGUAGE : $user_language );$fmtdate = ( $timetype == 'T' ? date ( 'Ymd',$eventstart ) : gmdate ( 'Ymd', $eventstart ) );$msg = str_replace ( 'XXX', $tempfullname,$helloStr ) . "\n\n" // translate ( 'An appointment has been canceled for you by' ) . str_replace ( 'XXX', $login_fullname, translate ( 'XXX has canceled an appointment.' ) ) . "\n" . str_replace ( 'XXX',$name, $subjStr ) . "\n\n" . str_replace ( 'XXX',$description, $descStr ) . "\n" . str_replace ( 'XXX', date_to_str ($fmtdate ), $dateStr ) . "\n" // Apply user's GMT offset and display their TZID. . ($timetype != 'T' ? '' : str_replace ( 'XXX', display_time ( '', 2, $eventstart,$t_format ), $timeStr . "\n\n\n" ) ); // Add URL to event, if we can figure it out. if ( ! empty ($SERVER_URL ) ) { // DON'T change & to & here. Email will handle it. $url =$SERVER_URL . 'view_entry.php?id=' . $id . '&em=1'; if ($htmlmail == 'Y' ) $url = activate_urls ($url ); $msg .=$url . "\n\n"; } $wantsAttach = get_pref_setting ($old_participant, 'EMAIL_ATTACH_ICS', 'N' ); $attachId = ($wantsAttach == 'Y' ? $id : '' );$mail->WC_Send ( $login_fullname,$tempemail, $tempfullname,$name, $msg,$htmlmail, $from,$attachId ); activity_log ( $id,$login, $old_participant, LOG_NOTIFICATION, translate ( 'User removed from participants list.' ) ); } } } }$send_own = get_pref_setting ( $login, 'EMAIL_EVENT_CREATE' ); // Now add participants and send out notifications. for ($i = 0; $i <$partcnt; $i++ ) { // Is the person adding the nonuser calendar admin?$is_nonuser_admin = user_is_nonuser_admin ( $login,$participants[$i] ); // If public access, require approval unless //$PUBLIC_ACCESS_ADD_NEEDS_APPROVAL is set to 'N' if ( $login == '__public__' ) {$status = ( ! empty ( $PUBLIC_ACCESS_ADD_NEEDS_APPROVAL ) &&$PUBLIC_ACCESS_ADD_NEEDS_APPROVAL == 'N' ? 'A' // No approval needed. : 'W' // Approval required. ); // Percent will always be 0 for Public $new_percent = 0; } else if ( !$newevent ) { // Keep the old status if no email will be sent. $send_user_mail = ( empty ($old_status[$participants[$i]] ) || $entry_changed );$tmp_status = ( ! empty ( $old_status[$participants[$i]] ) && !$send_user_mail ? $old_status[$participants[$i]] : 'W' );$status = ( $participants[$i] != $login && boss_must_approve_event ($login, $participants[$i] ) && $REQUIRE_APPROVALS == 'Y' && !$is_nonuser_admin ? $tmp_status : 'A' ); // Set percentage to old_percent if not owner.$tmp_percent = ( empty ( $old_percent[$participants[$i]] ) ? 0 :$old_percent[$participants[$i]] ); // TODO: This logic needs work. $new_percent = ($participants[$i] !=$login ? $tmp_percent :$percent ); // If user is admin and this event was previously approved for public, // keep it as approved even though date/time may have changed. // This goes against stricter security, but it confuses users to have // to re-approve events they already approved. if ( $participants[$i] == '__public__' && $is_admin && ( empty ($old_status['__public__'] ) || $old_status['__public__'] == 'A' ) )$status = 'A'; } else { // New Event. $send_user_mail = true;$status = ( $participants[$i] != $login && boss_must_approve_event ($login, $participants[$i] ) && $REQUIRE_APPROVALS == 'Y' && !$is_nonuser_admin ? 'W' : 'A' ); $new_percent = ($participants[$i] !=$login ? 0 : $percent ); // If admin, no need to approve Public Access Events if ($participants[$i] == '__public__' &&$is_admin ) $status = 'A'; } //end new/old event // Some users report that they get an error on duplicate keys // on the following add... As a safety measure, delete any // existing entry with the id. Ignore the result. dbi_execute ( 'DELETE FROM webcal_entry_user WHERE cal_id = ? AND cal_login = ?', array ($id, $participants[$i] ) ); if ( ! dbi_execute ( 'INSERT INTO webcal_entry_user ( cal_id, cal_login, cal_status, cal_percent ) VALUES ( ?, ?, ?, ? )', array ( $id,$participants[$i],$status, $new_percent ) ) ) {$error = $dberror . dbi_error (); break; } else { // Check UAC.$can_email = 'Y'; if ( access_is_enabled () ) $can_email = access_user_calendar ( 'email',$participants[$i],$login ); // Don't send mail if we are editing a non-user calendar and we are the admin. if ( !$is_nonuser_admin &&$can_email == 'Y' ) { // Only send mail if their email address is filled in. $do_send = get_pref_setting ($participants[$i],$newevent ? 'EMAIL_EVENT_ADDED' : 'EMAIL_EVENT_UPDATED' ); $htmlmail = get_pref_setting ($participants[$i], 'EMAIL_HTML' );$t_format = get_pref_setting ( $participants[$i], 'TIME_FORMAT' ); $user_TIMEZONE = get_pref_setting ($participants[$i], 'TIMEZONE' ); set_env ( 'TZ',$user_TIMEZONE ); $user_language = get_pref_setting ($participants[$i], 'LANGUAGE' ); user_load_variables ($participants[$i], 'temp' ); if ( boss_must_be_notified ($login, $participants[$i] ) && ! empty ( $tempemail ) &&$do_send == 'Y' && $send_user_mail &&$SEND_EMAIL != 'N' ) { // We send to creator if they want it. if ( $send_own != 'Y' && ($participants[$i] ==$login ) ) continue; reset_language ( empty ( $user_language ) || ($user_language == 'none' ) ? $LANGUAGE :$user_language ); $fmtdate = ($timetype == 'T' ? date ( 'Ymd', $eventstart ): gmdate ( 'Ymd',$eventstart ) ); $msg = str_replace ( 'XXX',$tempfullname, $helloStr ) . "\n\n" . str_replace ( 'XXX',$login_fullname, ( $newevent || ( empty ($old_status[$participants[$i]] ) ) ? $newAppStr :$updAppStr ) ) . "\n" . str_replace ( 'XXX', $name,$subjStr ) . "\n\n" . str_replace ( 'XXX', $description,$descStr ) . "\n" . str_replace ( 'XXX', date_to_str ( $fmtdate ),$dateStr ) . "\n" // Apply user's GMT offset and display their TZID . ( $timetype != 'T' ? '' : str_replace ( 'XXX', display_time ( '', 2,$eventstart, $t_format ),$timeStr ) . "\n" ) // Add Site Extra Date if permitted. . $extra_email_data // translate ( 'Please look on' ) // translate ( 'to accept or reject this appointment' ) // translate ( 'to view this appointment' ) . str_replace ( 'XXX', generate_application_name (), ($REQUIRE_APPROVALS == 'Y' ? translate ( 'Please look on XXX to accept or reject this appointment.' ) : translate ( 'Please look on XXX to view this appointment.' ) ) ); // Add URL to event, if we can figure it out. if ( ! empty ( $SERVER_URL ) ) { // DON'T change & to & here. Email will handle it.$url = $SERVER_URL . 'view_entry.php?id=' .$id . '&em=1'; if ( $htmlmail == 'Y' )$url = activate_urls ( $url );$msg .= "\n\n" . $url; }$wantsAttach = get_pref_setting ( $participants[$i], 'EMAIL_ATTACH_ICS', 'N' ); $attachId = ($wantsAttach == 'Y' ? $id : '' ); // Use WebCalMailer class.$mail->WC_Send ( $login_fullname,$tempemail, $tempfullname,$name, $msg,$htmlmail, $from,$attachId ); activity_log ( $id,$login, $participants[$i], LOG_NOTIFICATION, '' ); } } } } //end for loop participants // Add external participants. $ext_emails =$ext_names = $matches = array ();$ext_count = 0; $externalparticipants = getPostValue ( 'externalparticipants' ); if ($single_user == 'N' && ! empty ( $ALLOW_EXTERNAL_USERS ) &&$ALLOW_EXTERNAL_USERS == 'Y' && ! empty ( $externalparticipants ) ) {$lines = explode ( "\n", $externalparticipants ); if ( ! is_array ($lines ) ) $lines = array ($externalparticipants ); if ( is_array ( $lines ) ) {$linecnt = count ( $lines ); for ($i = 0; $i <$linecnt; $i++ ) {$ext_words = explode ( ' ', $lines[$i] ); if ( ! is_array ( $ext_words ) )$ext_words = array ( $lines[$i] ); if ( is_array ( $ext_words ) ) {$ext_wordscnt = count ( $ext_words );$ext_emails[$ext_count] =$ext_names[$ext_count] = ''; for ($j = 0; $j <$ext_wordscnt; $j++ ) { // Use regexp matching to pull email address out.$ext_words[$j] = chop ($ext_words[$j] ); // Remove \r if there is one. if ( preg_match ( '/?/',$ext_words[$j],$matches ) ) { $ext_emails[$ext_count] = $matches[0];$ext_emails[$ext_count] = preg_replace ( '/[<>]/', '',$ext_emails[$ext_count] ); } else { if ( strlen ($ext_names[$ext_count] ) )$ext_names[$ext_count] .= ' ';$ext_names[$ext_count] .=$ext_words[$j]; } } // Test for duplicate Names. if ($i > 0 ) { for ( $k =$i - 1; $k > 0;$k-- ) { if ( $ext_names[$i] == $ext_names[$k] ) $ext_names[$i] .= "[$k]"; } } if ( strlen ($ext_emails[$ext_count] ) && empty ($ext_names[$ext_count] ) )$ext_names[$ext_count] =$ext_emails[$ext_count];$ext_count++; } } } } // Send notification if enabled. if ( is_array ( $ext_names ) && is_array ($ext_emails ) ) { $ext_namescnt = count ($ext_names ); for ( $i = 0;$i < $ext_namescnt;$i++ ) { if ( strlen ( $ext_names[$i] ) ) { if ( ! dbi_execute ( 'INSERT INTO webcal_entry_ext_user ( cal_id, cal_fullname, cal_email ) VALUES ( ?, ?, ? )', array ( $id,$ext_names[$i], ( strlen ($ext_emails[$i] ) ?$ext_emails[$i] : null ) ) ) )$error = $dberror . dbi_error (); // Send mail notification if enabled. // TODO: Move this code into a function... if ($EXTERNAL_NOTIFICATIONS == 'Y' && $SEND_EMAIL != 'N' && strlen ($ext_emails[$i] ) > 0 ) { if ( ( !$newevent && isset ( $EXTERNAL_UPDATES ) &&$EXTERNAL_UPDATES == 'Y' ) || $newevent ) {$fmtdate = ( $timetype == 'T' ? date ( 'Ymd',$eventstart ) : gmdate ( 'Ymd', $eventstart ) ); // Strip [\d] from duplicate Names before emailing.$ext_names[$i] = trim ( preg_replace ( '/\[[\d]]/', '',$ext_names[$i] ) );$msg = str_replace ( 'XXX', $ext_names[$i], $helloStr ) . "\n\n" . str_replace ( 'XXX',$login_fullname, ( $newevent ?$newAppStr : $updAppStr ) ) . "\n" . str_replace ( 'XXX',$name, $subjStr ) . "\n\n" . str_replace ( 'XXX',$description, $descStr ) . "\n\n" . str_replace ( 'XXX', date_to_str ($fmtdate ), $dateStr ) . "\n" . ($timetype == 'T' ? str_replace ( 'XXX', display_time ( '', ( ! empty ( $GENERAL_USE_GMT ) &&$GENERAL_USE_GMT == 'Y' ? 3 // Do not apply TZ offset & display TZID, which is GMT. : 6 // Display time in server's timezone. ), $eventstart ),$timeStr ) : '' ) // Add Site Extra Date if permitted. . $extra_email_data; // Don't send HTML to external adresses. // Always attach iCalendar file to external users$mail->WC_Send ( $login_fullname,$ext_emails[$i],$ext_names[$i],$name, $msg, 'N',$from, $id ); } } } } } //end external mail } //end empty error // If we were editing this event, then go back to the last view (day, month, week). // If this is a new event, // then go to the preferred view for the date range where this event was added. if ( empty ($error ) && empty ( $mailerError ) ) {$return_view = get_last_view (); if ( ! empty ( $return_view ) ) do_redirect ($return_view ); else { $xdate = sprintf ( "%04d%02d%02d",$year, $month,$day ); $user_args = ( empty ($user ) ? '' : 'user=' . $user ); send_to_preferred_view ($xdate, $user_args ); } } if ( ! empty ($conflicts ) ) { print_header (); ob_start (); echo '

' . translate ( 'Scheduling Conflict' ) . '

' . translate ( 'Your suggested time of' ) . ' '; if ( $timetype == 'A' ) etranslate ( 'All day event' ); else {$time = sprintf ( "%d%02d00", $entry_hour,$entry_minute ); // Pass the adjusted timestamp in case the date changed due to GMT offset. echo display_time ( '', 0, $eventstart ); if ($duration > 0 ) echo '-' . display_time ( '', 0, $eventstart + ($duration * 60 ) ); } echo ' ' . translate ( 'conflicts with the following existing calendar entries' ) . ':
' . $conflicts . ' ' // User can confirm conflicts. . ' '; foreach ($_POST as $xkey =>$xval ) { if ( is_array ( $xval ) ) {$xkey .= "[]"; foreach ( $xval as$ykey => $yval ) { if ( get_magic_quotes_gpc () )$yval = stripslashes ( $yval ); //$yval = htmlentities ( $yval ); echo ' '; } } else { if ( get_magic_quotes_gpc () )$xval = stripslashes ( $xval ); //$xval = htmlentities ( $xval ); echo ' '; } } echo ' ' // Allow them to override a conflict if server settings allow it. . ( ! empty ($ALLOW_CONFLICT_OVERRIDE ) && $ALLOW_CONFLICT_OVERRIDE == 'Y' ? ' ' : '' ) . ' '; ob_end_flush (); } else // Process errors.$mail->MailError ( $mailerError,$error ); ?> 

     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175  ' : '' ); $publicStr = ($updating_public ? translate ( $PUBLIC_ACCESS_FULLNAME ) . ' ' : '' );$titleStr = ( empty ( $layers[$id]['cal_layeruser'] ) ? translate ( 'Add Layer' ) : translate ( 'Edit Layer' ) ); print_header ( array ( 'js/edit_layer.php', 'js/visible.php' ) ); ob_start (); echo <<{$publicStr}{$titleStr}
{$hiddenStr} EOT; if ($single_user == 'N' ) { $otherlist =$userlist = get_my_users ( '', 'view' ); if ( $NONUSER_ENABLED == 'Y' ) { // Restrict NUC list if groups are enabled.$nonusers = get_my_nonusers ( $login, true, 'view' );$userlist = ( $NONUSER_AT_TOP == 'Y' ? array_merge ($nonusers, $userlist ) : array_merge ($userlist, $nonusers ) ); } if ($REMOTES_ENABLED == 'Y' ) { $remotes = get_nonuser_cals ($login, true ); $userlist = ($NONUSER_AT_TOP == 'Y' ? array_merge ( $remotes,$userlist ) : array_merge ( $userlist,$remotes ) ); } $num_users =$osize = $size = 0;$others = $users = ''; for ($i = 0, $cnt = count ($userlist ); $i <$cnt; $i++ ) { if ($userlist[$i]['cal_login'] !=$layer_user ) { $size++;$users .= ' '; } } for ( $i = 0,$cnt = count ( $otherlist );$i < $cnt;$i++ ) { if ( $otherlist[$i]['cal_login'] != $layer_user ) {$osize++; $others .= ' '; } } if ($size > 50 ) $size = 15; elseif ($size > 5 ) $size = 5; if ($osize > 50 ) $osize = 15; elseif ($osize > 5 ) $osize = 5; if ($size > 0 ) { $sourceStr = translate ( 'Source' ); echo << {$colorHtmlStr}
{$duplicatesStr}: {$addmyStr}:
{$deleteStr} EOT; } }$colorHtmlStr = print_color_input_html ( 'layercolor', translate ( 'Color' ), $color );$duplicatesStr = translate ( 'Duplicates' ); $dupsChecked = ( ! empty ($layers[$id]['cal_dups'] ) &&$layers[$id]['cal_dups'] == 'Y' ?$checked : '' ); $showStr = translate ( 'Show layer events that are the same as your own' ); echo << EOT; // If admin and adding a new layer, add ability to select other users. if ($is_admin && empty ( $layers[$id]['cal_layeruser'] ) && empty ( $public ) ) {$addStr = translate ( 'Add to Others' ); $addmyStr = translate ( 'Add to My Calendar' ); echo << EOT; }$saveStr = translate ( 'Save' ); // If a layer already exists put a 'Delete Layer' link. $deleteStr = ( ! empty ($layers[$id]['cal_layeruser'] ) ? ' ' : '' );$hiddenStr = ( ! empty ( $layers[$id]['cal_layeruser'] ) ? ' ' : '' ); echo << {$hiddenStr} EOT; ob_end_flush (); echo print_trailer (); ?>  Added edit_layer_handler.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94   0 )$error = translate ( 'You can only create one layer for each user.' ); dbi_free_result ( $res ); } if ($error == '' ) { $res = dbi_execute ( 'SELECT MAX( cal_layerid ) FROM webcal_user_layers' ); if ($res ) { $row = dbi_fetch_row ($res ); $layerid =$row[0] + 1; } else $layerid = 1; dbi_execute ( 'INSERT INTO webcal_user_layers ( cal_layerid, cal_login, cal_layeruser, cal_color, cal_dups ) VALUES ( ?, ?, ?, ?, ? )', array ($layerid, $layer_user,$layeruser, $layercolor,$dups ) ); } } } } // We don't want to throw errors if doing a multiple save. if ( $error == '' || ! empty ($cal_login ) ) { do_redirect ( 'layers.php' . ( $updating_public ? '?public=1' : '' ) ); exit; } print_header (); echo print_error ($error ) . print_trailer (); ?> 

     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135   '; exit; } if ( ! $NONUSER_PREFIX ) { echo print_error_header () . translate ( 'NONUSER_PREFIX not set' ) . '. '; exit; }$add = getValue ( 'add' ); $nid = getValue ( 'nid' ); // Adding/Editing nonuser calendar. if ( ( ($add == '1' ) || ( ! empty ( $nid ) ) ) && empty ($error ) ) { $userlist = user_get_users ();$button = translate ( 'Add', true ); $buttonAction = 'Add';$nid = clean_html ( $nid ); if ( ! empty ($nid ) ) { nonuser_load_variables ( $nid, 'nonusertemp_' );$id_display = $nid . ' ';$button = translate ( 'Save', true ); $buttonAction = 'Save'; //$nonusertemp_login = substr ( $nonusertemp_login, // strlen ($NONUSER_PREFIX ) ); } else $id_display = ' ' . translate ( 'word characters only' ); ob_start (); echo ' ' . ( empty ($nonusertemp_admin ) ? '' : ' ' ) . '

' . ( empty ( $nid ) ? translate ( 'Add User' ) : translate ( 'Edit User' ) ) . ' ' .$id_display . '
' . translate ( 'Yes' ) . '   ' . translate ( 'No' ) . '
'; if ( ! empty ( $nonusertemp_login ) ) {$nu_url = $SERVER_URL . 'nulogin.php?login=' .$nonusertemp_login; echo $nu_url; } echo ' '; if ( !$use_http_auth ) { echo ' '; } echo '
' . ( empty ( $nid ) ? '' : ' ' ) . ' '; } ob_end_flush (); echo print_trailer ( false, true, true ); ?>  Added edit_nonusers_handler.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141  \n"; exit; }$error = ''; $save = getPostValue ( 'Save' );$add = getPostValue ( 'Add' ); $delete = getPostValue ( 'delete' );$nid = getPostValue ( 'nid' ); $nfirstname = getPostValue ( 'nfirstname' );$nlastname = getPostValue ( 'nlastname' ); $nadmin = getPostValue ( 'nadmin' );$old_admin = getPostValue ( 'old_admin' ); $ispublic = getPostValue ( 'ispublic' ); if ( empty ($ispublic ) ) $ispublic = 'N'; if ( ! empty ($delete ) ) { // delete this nonuser calendar // Get event ids for all events this user is a participant $events = get_users_event_ids ($nid ); // Now count number of participants in each event... // If just 1, then save id to be deleted $delete_em = array (); for ($i = 0, $cnt = count ($events ); $i <$cnt; $i++ ) {$res = dbi_execute ( 'SELECT COUNT( * ) FROM webcal_entry_user WHERE cal_id = ?', array ( $events[$i] ) ); if ( $res ) { if ($row = dbi_fetch_row ( $res ) ) { if ($row[0] == 1 ) $delete_em[] =$events[$i]; } dbi_free_result ($res ); } } // Now delete events that were just for this user for ( $i = 0,$cnt = count ( $delete_em );$i < $cnt;$i++ ) { dbi_execute ( 'DELETE FROM webcal_entry_repeats WHERE cal_id = ?', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_entry_repeats_not WHERE cal_id = ?', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_entry_log WHERE cal_entry_id = ?', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_import_data WHERE cal_id = ?', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_site_extras WHERE cal_id = ?', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_entry_ext_user WHERE cal_id = ?', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_reminders WHERE cal_id =? ', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_blob WHERE cal_id = ?', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_entry WHERE cal_id = ?', array ( $delete_em[$i] ) ); } // Delete user participation from events dbi_execute ( 'DELETE FROM webcal_entry_user WHERE cal_login = ?', array ( $nid ) ); // Delete any layers other users may have that point to this user. dbi_execute ( 'DELETE FROM webcal_user_layers WHERE cal_layeruser = ?', array ($nid ) ); // Delete any UAC calendar access entries for this user. dbi_execute ( 'DELETE FROM webcal_access_user WHERE cal_login = ? OR cal_other_user = ?', array ( $nid,$nid ) ); // Delete any UAC function access entries for this user. dbi_execute ( 'DELETE FROM webcal_access_function WHERE cal_login = ?', array ( $nid ) ); // Delete user if ( ! dbi_execute ( 'DELETE FROM webcal_nonuser_cals WHERE cal_login = ?', array ($nid ) ) ) $error = db_error (); } else if ( ! empty ($save ) ) { // Updating $query_params = array ();$sql = 'UPDATE webcal_nonuser_cals SET '; if ($nlastname) {$sql .= ' cal_lastname = ?, '; $query_params[] =$nlastname; } if ($nfirstname) {$sql .= ' cal_firstname = ?, '; $query_params[] =$nfirstname; } if ( $ispublic ) {$sql .= ' cal_is_public = ?, '; $query_params[] =$ispublic; } $query_params[] =$nadmin; $query_params[] =$nid; if ( ! dbi_execute ( $sql . 'cal_admin = ? WHERE cal_login = ?',$query_params ) ) $error = db_error (); } else if ( ! empty ($add ) ){ // Adding if ( preg_match ( '/^[\w]+$/',$nid ) ) { $nid =$NONUSER_PREFIX.$nid; if ( ! dbi_execute ( 'INSERT INTO webcal_nonuser_cals ( cal_login, cal_firstname, cal_lastname, cal_admin, cal_is_public ) VALUES ( ?, ?, ?, ?, ? )', array ($nid, $nfirstname,$nlastname, $nadmin,$ispublic ) ) ) { $error = db_error (); } } else {$error = translate ( 'Calendar ID' ).' '.translate ( 'word characters only' ).'.'; } //Add entry in UAC access table for new admin and remove for of admin //first delete any record for this user/nuc combo dbi_execute ( 'DELETE FROM webcal_access_user WHERE cal_login = ? AND cal_other_user = ?', array ( $nadmin,$nid ) ); if ( ! dbi_execute ( 'INSERT INTO webcal_access_user ( cal_login, cal_other_user, cal_can_view, cal_can_edit, cal_can_approve, cal_can_invite, cal_can_email, cal_see_time_only ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? )', array ( $nadmin,$nid, 511, 511, 511, 'Y', 'Y', 'N' ) ) ) { die_miserable_death ( translate ( 'Database error' ) . ': ' . dbi_error () ); } // Delete old admin... //TODO Make this an optional step if ( ! empty ( $old_admin ) ) dbi_execute ( 'DELETE FROM webcal_access_user WHERE cal_login = ? AND cal_other_user = ?', array ($old_admin, $nid ) ); } echo error_check('users.php?tab=nonusers', false); ?>  Added edit_remotes.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142   * @copyright Craig Knudsen, , http://www.k5n.us/cknudsen * @license http://www.gnu.org/licenses/gpl.html GNU GPL * @version$Id: edit_remotes.php,v 1.17.2.4 2007/11/12 20:47:48 umcesrjones Exp $* @package WebCalendar * @subpackage Edit Remotes * * Security *$REMOTES_ENABLED must be enabled under System Settings and if * if UAC is enabled, then the user must be allowed to ACCESS_IMPORT. */ include_once 'includes/init.php'; print_header ( array ( 'js/edit_remotes.php/false', 'js/visible.php' ), '', '', true ); $error = ''; if ( !$NONUSER_PREFIX ) $error = translate ( 'NONUSER_PREFIX not set' ); if ($REMOTES_ENABLED != 'Y' || ( access_is_enabled () && ! access_can_access_function ( ACCESS_IMPORT ) ) ) $error = print_not_auth (11); if ($error ) { echo print_error ( $error ) . ' '; exit; }$add = getValue ( 'add' ); $nid = getValue ( 'nid' ); // Adding/Editing remote calendar. if ( ($add == '1' || ! empty ( $nid ) ) && empty ($error ) ) { $userlist = get_nonuser_cals ($login, true ); if ( empty ( $nid ) ) {$id_display = ' ' . translate ( 'word characters only' ); $lableStr = translate ( 'Add Remote Calendar' ); } else {$nid = clean_html ( $nid ); nonuser_load_variables ($nid, 'remotestemp_' ); $button = translate ( 'Save' );$buttonAction = 'Save'; $id_display =$nid . ' '; $lableStr = translate ( 'Edit Remote Calendar' );$remotestemp_login = substr ( $remotestemp_login, strlen ($NONUSER_PREFIX ) ); } $button = translate ( 'Add' );$buttonAction = 'Add'; $calIdStr = translate ( 'Calendar ID' );$colorStr = translate ( 'Color' ); $confirmStr = str_replace ( 'XXX', translate ( 'entry' ), translate ( 'Are you sure you want to delete this XXX?' ) );$createLayerStr = translate ( 'Create Layer' ); $deleteStr = translate ( 'Delete' );$firstNameStr = translate ( 'First Name' ); $lastNameStr = translate ( 'Last Name' );$reloadStr = translate ( 'Reload' ); $requiredStr = translate ( 'Required to View Remote Calendar' );$selectStr = translate ( 'Select' ); $urlStr = translate ( 'URL' );$firstNameValue = ( empty ( $remotestemp_firstname ) ? '' : htmlspecialchars ($remotestemp_firstname ) ); $lastNameValue = ( empty ($remotestemp_lastname ) ? '' : htmlspecialchars ( $remotestemp_lastname ) );$urlValue = ( empty ( $remotestemp_url ) ? '' : htmlspecialchars ($remotestemp_url ) ); echo <<{$lableStr} {$id_display}
{$requiredStr} EOT; if ( empty ($nid ) ) { echo << '; } echo << EOT; if ( ! empty ( $nid ) ) echo << EOT; echo ' '; } echo print_trailer ( false, true, true ); ?>  Added edit_remotes_handler.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213  tidy_mode = 'proxy';$result = $h->getByURL ( 'hcal',$nurl ); $type = 'hcal';$data = parse_hcal ( $result,$type ); } $errorStr = ' ' . translate ( 'Error' ) . ': '; print_header ( '', '', '', true, false, true ); if ( count ($data ) && empty ( $errormsg ) ) { // Delete existing events. delete_events ($nid ); // Import new events. import_data ( $data,$overwrite, $type ); echo ' ' . translate ( 'Import Results' ) . ' ' . translate ( 'Events successfully imported' ) . ': ' .$count_suc . '
'; if ( $layer_found == false ) { // We may have just added layer. load_user_layers (); foreach ($layers as $layer ) { if ($layer['cal_layeruser'] == $nid )$layer_found = true; } } if ( $layer_found == false ) echo ' ' . translate ( 'Create a new layer to view this calendar' ) . '. '; } elseif ( ! empty ($errormsg ) ) { echo ' ' . translate ( 'Errors' ) . ': ' . $error_num . ' ' .$errorStr . $errormsg . ' '; } else { echo$errorStr . translate ( 'There was an error parsing the import file or no events were returned' ) . '.
'; } echo print_trailer ( false, true, true ); } function delete_events ( $nid ) { // Get event ids for all events this user is a participant.$events = get_users_event_ids ( $nid ); // Now count number of participants in each event... // If just 1, then save id to be deleted.$delete_em = array (); for ( $i = 0,$cnt = count ( $events );$i < $cnt;$i++ ) { $res = dbi_execute ( 'SELECT COUNT( * ) FROM webcal_entry_user WHERE cal_id = ?', array ($events[$i] ) ); if ($res ) { $row = dbi_fetch_row ($res ); if ( ! empty ( $row ) &&$row[0] == 1 ) $delete_em[] =$events[$i]; dbi_free_result ($res ); } } // Now delete events that were just for this user. for ( $i = 0,$cnt = count ( $delete_em );$i < $cnt;$i++ ) { dbi_execute ( 'DELETE FROM webcal_entry_repeats WHERE cal_id = ?', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_entry_repeats_not WHERE cal_id = ?', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_entry_log WHERE cal_entry_id = ?', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_import_data WHERE cal_id = ?', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_site_extras WHERE cal_id = ?', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_entry_ext_user WHERE cal_id = ?', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_reminders WHERE cal_id =? ', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_blob WHERE cal_id = ?', array ( $delete_em[$i] ) ); dbi_execute ( 'DELETE FROM webcal_entry WHERE cal_id = ?', array ( $delete_em[$i] ) ); } // Delete user participation from events. dbi_execute ( 'DELETE FROM webcal_entry_user WHERE cal_login = ?', array ( $nid ) ); } echo error_check ( 'users.php?tab=remotes', false ); ?>  Added edit_report.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433  report_id (optional) - the report id of the report to edit. If * blank, user is adding a new report. * - public (optional) - If set to '1' and user is an admin user, * then we are creating a report for the public user. * * @author Craig Knudsen * @copyright Craig Knudsen, , http://www.k5n.us/cknudsen * @license http://www.gnu.org/licenses/gpl.html GNU GPL * @version$Id: edit_report.php,v 1.58.2.4 2013/01/24 21:10:19 cknudsen Exp $* @package WebCalendar * @subpackage Reports */ /* Security: * If system setting$REPORTS_ENABLED is set to anything other than 'Y', * then don't allow access to this page. * If $ALLOW_VIEW_OTHER is 'N', then do not allow selection of participants. * Only report creator (cal_login in webcal_report), or an admin user, * can edit/delete report. */ include_once 'includes/init.php'; load_user_categories ();$adding_report = false; $charset = ( empty ($LANGUAGE ) ? 'iso-8859-1' : translate ( 'charset' ) ); $checked = ' checked="checked"';$error = ( empty ( $REPORTS_ENABLED ) ||$REPORTS_ENABLED != 'Y' || $login == '__public__' ? print_not_auth (12) : '' );$report_id = getValue ( 'report_id', '-?[0-9]+', true ); $selected = ' selected="selected"';$show_participants = ( $single_user == 'Y' ||$DISABLE_PARTICIPANTS_FIELD == 'Y' ? false : true ); $updating_public = ($is_admin && ! empty ( $public ) &&$PUBLIC_ACCESS == 'Y' ); $report_user = ($updating_public ? '__public__' : ''); if ( empty ( $report_id ) ) {$adding_report = true; $include_header =$report_allow_nav = 'Y'; $report_id = -1;$report_is_global = 'N'; } // Set date range options. $ranges = array ( '0' => translate ( 'Tomorrow' ), '1' => translate ( 'Today' ), '2' => translate ( 'Yesterday' ), '3' => translate ( 'Day before yesterday' ), '10' => translate ( 'Next week' ), '11' => translate ( 'This week' ), '12' => translate ( 'Last week' ), '13' => translate ( 'Week before last' ), '20' => translate ( 'Next week and week after' ), '21' => translate ( 'This week and next week' ), '22' => translate ( 'Last week and this week' ), '23' => translate ( 'Last two weeks' ), '30' => translate ( 'Next month' ), '31' => translate ( 'This month' ), '32' => translate ( 'Last month' ), '33' => translate ( 'Month before last' ), '40' => translate ( 'Next year' ), '41' => translate ( 'This year' ), '42' => translate ( 'Last year' ), '43' => translate ( 'Year before last' ), '50' => translate ( 'Next 14 days' ), '51' => translate ( 'Next 30 days' ), '52' => translate ( 'Next 60 days' ), '53' => translate ( 'Next 90 days' ), '54' => translate ( 'Next 180 days' ), '55' => translate ( 'Next 365 days' ), ); // Get list of users visible to the current user. if ( empty ($error ) && $show_participants ) {$userlist = get_my_users ( '', 'view' ); if ( $NONUSER_ENABLED == 'Y' ) { // Restrict NUC list if groups are enabled.$nonusers = get_my_nonusers ( $login, true, 'view' );$userlist = ( $NONUSER_AT_TOP == 'Y' ? array_merge ($nonusers, $userlist ) : array_merge ($userlist, $nonusers ) ); }$userlistcnt = count ( $userlist ); } // Default values.$day_template = '
${date}${events}
'; $event_template = '${name}
' . translate ( 'Date' ) . ': ${date} ' . translate ( 'Time' ) . ':${time}
${description} ';$page_template = '
${days} '; // Setup option arrays.$day_options = array ( 'events', 'date', 'fulldate', 'report_id' ); $event_options = array ( 'name', 'description', 'date', 'fulldate', 'time', 'starttime', 'endtime', 'duration', 'location', 'url', 'priority', 'href', 'user', 'fullname', 'report_id' );$page_options = array ( 'days', 'report_id' ); /* Generate clickable option lists. */ function print_options ( $textarea,$option ) { // Use ASCII values for ${}. echo '${' . $option . '} '; } if ( empty ($error ) && $report_id >= 0 ) {$res = dbi_execute ( 'SELECT cal_login, cal_report_id, cal_is_global, cal_report_type, cal_include_header, cal_report_name, cal_time_range, cal_user, cal_allow_nav, cal_cat_id, cal_include_empty, cal_show_in_trailer, cal_update_date FROM webcal_report WHERE cal_report_id = ?', array ( $report_id ) ); if ($res ) { if ( $row = dbi_fetch_row ($res ) ) { $i = 0;$report_login = $row[$i++]; $report_id =$row[$i++];$report_is_global = $row[$i++]; $report_type =$row[$i++];$report_include_header = $row[$i++]; $report_name =$row[$i++];$report_time_range = $row[$i++]; $report_user =$row[$i++];$report_allow_nav = $row[$i++]; $report_cat_id =$row[$i++];$report_include_empty = $row[$i++]; $report_show_in_menu =$row[$i++];$report_update_date = $row[$i++]; // Check permissions. if ( $show_participants && ! empty ($report_user ) ) { $user_is_in_list = false; for ($i = 0; $i <$userlistcnt; $i++ ) { if ($report_user == $userlist[$i]['cal_login'] ) $user_is_in_list = true; } if ( !$user_is_in_list && $report_login !=$login && ! $is_admin )$error = print_not_auth (13); } if ( ! $is_admin &&$login != $report_login ) // Only creator or an admin can edit/delete the event.$error = print_not_auth (3); // If we are editing a public user report we need to set $updating_public. if ($is_admin && $report_login == '__public__' )$updating_public = true; } else // translate ( 'Invalid report id.' ) $error = str_replace ( 'XXX',$report_id, translate ( 'Invalid report id XXX.' ) ); dbi_free_result ( $res ); } else$error = db_error (); $res = dbi_execute ( 'SELECT cal_template_type, cal_template_text FROM webcal_report_template WHERE cal_report_id = ?', array ($report_id ) ); if ( $res ) { while ($row = dbi_fetch_row ( $res ) ) { if ($row[0] == 'D' ) $day_template =$row[1]; elseif ( $row[0] == 'E' )$event_template = $row[1]; elseif ($row[0] == 'P' ) $page_template =$row[1]; } dbi_free_result ( $res ); } } else { // Default values for new report.$report_allow_nav = $report_include_header = 'Y';$report_cat_id = $report_update_date = '';$report_id = -1; $report_include_empty =$report_is_global = $report_show_in_menu = 'N';$report_login = $login;$report_name = translate ( 'Unnamed Report' ); $report_time_range = 11; // Current week.$report_type = 'html'; // $report_user already set. } print_header (); if ( ! empty ($error ) ) { echo $error . print_trailer ( false ); exit; } ob_start (); echo ' ' . ($updating_public ? translate ( $PUBLIC_ACCESS_FULLNAME ) . ' ' : '' ) . ($adding_report ? translate ( 'Add Report' ) : translate ( 'Edit Report' ) ) . '

' . ( $updating_public ? ' ' : '' ) . ( !$adding_report ? ' ' : '' ) . '
' . print_radio ( 'is_global', '', '', ( ! empty ( $report_is_global ) && ($report_is_global == 'Y' ? 'Y' : 'N' ) ) ) . '
' . print_radio ( 'show_in_trailer', '', '', ( ! empty ( $report_show_in_menu ) && ($report_show_in_menu == 'Y' ? 'Y' : 'N' ) ) ) . '
' . print_radio ( 'include_header', '', '', ( ! empty ( $report_include_header ) && ($report_include_header == 'Y' ? 'Y' : 'N' ) ) ) . '
' . print_radio ( 'allow_nav', '', '', ( ! empty ( $report_allow_nav ) && ($report_allow_nav == 'Y' ? 'Y' : 'N' ) ) ) . '
' . print_radio ( 'include_empty', '', '', ( ! empty ( $report_include_empty ) && ($report_include_empty == 'Y' ? 'Y' : 'N' ) ) ) . '
'; if ( $show_participants ) { echo ' '; } echo ($is_admin ? ' ' // The report will always be shown in the menu for the creator of the report. // For admin users who create a global report, // allow option of adding to all users menu. . ' ' : '' ) . ' '; if ( $CATEGORIES_ENABLED == 'Y' ) { echo ' '; } //end$CATEGORIES_ENABLED test echo '

'; foreach ( $page_options as$option ) { print_options ( 'page_template', $option ); } echo ' '; foreach ($day_options as $option ) { print_options ( 'day_template',$option ); } echo '
'; foreach ( $event_options as$option ) { print_options ( 'event_template', $option ); } echo ' ';$extra_names = get_site_extras_names( EXTRA_DISPLAY_REPORT ); if ( count ( $extra_names ) > 0 ) echo ' '; foreach ($extra_names as $name ) { print_options ( 'event_template', 'extra:' .$name ); } echo '
' . ( $adding_report ? '' : ' ' ); ob_end_flush (); ?>  Added edit_report_handler.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204   0 && !$is_admin ) { $res = dbi_execute ( 'SELECT cal_login FROM webcal_report WHERE report_id = ?', array ($report_id ) ); if ( $res ) { if ($row = dbi_fetch_row ( $res ) ) { if ($row[0] != $login )$error = print_not_auth (5); } else $error = str_replace ( 'XXX',$report_id, translate ( 'No such report id XXX.' ) ); dbi_free_result ( $res ); } else$error = db_error (); } // Validate templates to make sure the required variables are found. // Page template must include ${days}. if ( empty ($error ) ) { $errStr = ' ' . translate ( 'Error' ) . ' ['; // translate ( 'Variable N not found' )$noVarXXX = ']: ' . translate ( 'Variable XXX not found.' ) . '

'; if ( ! strstr ( $page_template, '${days}' ) ) $error .=$errStr . translate ( 'Page template' ) . str_replace ( 'XXX', '${days}',$noVarXXX ); // Day template must include ${events}. if ( ! strstr ($day_template, '${events}' ) )$error .= $errStr . translate ( 'Day template' ) . str_replace ( 'XXX', '${events}', $noVarXXX ); // Event template must include${name}. if ( ! strstr ( $event_template, '${name}' ) ) $error .=$errStr . translate ( 'Event template' ) . str_replace ( 'XXX', '${name}',$noVarXXX ); } $delete = getPostValue ( 'delete' ); if ( empty ($error ) && ! empty ( $report_id ) && ! empty ($delete ) ) { if ( ! dbi_execute ( 'DELETE FROM webcal_report_template WHERE cal_report_id = ?', array ( $report_id ) ) )$error = db_error (); if ( empty ( $error ) && ! dbi_execute ( 'DELETE FROM webcal_report WHERE cal_report_id = ?', array ($report_id ) ) ) $error = db_error (); // Send back to main report listing page. if ( empty ($error ) ) do_redirect ( 'report.php' ); } if ( empty ( $error ) ) { if ( empty ($report_name ) || trim ( $report_name ) == '' )$report_name = translate ( 'Unnamed Report' ); $names = array ( 'cal_login', 'cal_update_date', 'cal_report_type', 'cal_report_name', 'cal_user', 'cal_include_header', 'cal_time_range', 'cal_cat_id', 'cal_allow_nav', 'cal_include_empty', 'cal_is_global', 'cal_show_in_trailer' );$values = array ( ( $updating_public ? '__public__' :$login ), date ( 'Ymd' ), 'html', $report_name, ( !$is_admin || empty ( $report_user ) ? null :$report_user ), ( empty ( $include_header ) ||$include_header != 'Y' ? 'N' : 'Y' ), ( isset ( $time_range ) ?$time_range : 11 ), ( empty ( $cat_id ) ? null :$cat_id ), ( empty ( $allow_nav ) ||$allow_nav != 'Y' ? 'N' : 'Y' ), ( empty ( $include_empty ) ||$include_empty != 'Y' ? 'N' : 'Y' ), ( empty ( $is_global ) ||$is_global != 'Y' ? 'N' : 'Y' ), ( empty ( $show_in_trailer ) ||$show_in_trailer != 'Y' ? 'N' : 'Y' ) ); if ( $adding_report ) {$newid = 1; $res = dbi_execute ( 'SELECT MAX( cal_report_id ) FROM webcal_report' ); if ($res ) { if ( $row = dbi_fetch_row ($res ) ) $newid =$row[0] + 1; dbi_free_result ( $res ); }$names[] = 'cal_report_id'; $values[] =$newid; $sql = 'INSERT INTO webcal_report ( ';$sql_v = ''; $namecnt = count ($names ); for ( $i = 0;$i < $namecnt;$i++ ) { $sql .= ($i > 0 ? ', ' : '' ) . $names[$i]; $sql_v .= ($i > 0 ? ', ' : '' ) . '?'; } $sql .= ' ) VALUES ( ' .$sql_v . ' )'; $report_id =$newid; } else { $sql = 'UPDATE webcal_report SET ';$namecnt = count ( $names ); for ($i = 0; $i <$namecnt; $i++ ) {$sql .= ( $i > 0 ? ', ' : '' ) . "$names[$i] = ?"; }$sql .= ' WHERE cal_report_id = ?'; $values[] =$report_id; // Push the $report_id to$values. } } if ( empty ( $error ) && ! dbi_execute ($sql, $values ) )$error = db_error (); if ( empty ( $error ) ) { if ( !$adding_report ) { if ( ! dbi_execute ( 'DELETE FROM webcal_report_template WHERE cal_report_id = ?', array ( $report_id ) ) )$error = db_error (); } $ins_sql = 'INSERT INTO webcal_report_template ( cal_report_id, cal_template_type, cal_template_text ) VALUES ( ?, ?, ? )'; if ( empty ($error ) && ! dbi_execute ( $ins_sql, array ($report_id, 'D', $day_template ) ) )$error = db_error (); if ( empty ( $error ) && ! dbi_execute ($ins_sql, array ( $report_id, 'E',$event_template ) ) ) $error = db_error (); if ( empty ($error ) && ! dbi_execute ( $ins_sql, array ($report_id, 'P', $page_template ) ) )$error = db_error (); } if ( empty ( $error ) ) { do_redirect ( 'report.php' . ($updating_public ? '?public=1' : '' ) ); exit; } print_header (); echo print_error ( $error ) . print_trailer (); ?>  Added edit_template.php.      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143  '; exit; }$query_params = array ( getPostValue ( 'template' ), $type,$user ); if ( $found )$sql = 'UPDATE webcal_user_template SET cal_template_text = ? WHERE cal_type = ? AND cal_login = ?'; else { $sql = 'INSERT INTO webcal_user_template ( cal_template_text, cal_type, cal_login ) VALUES ( ?, ?, ? )'; if ($foundOld && $user == '__system__' ) // User is upgrading from WebCalendar 1.0 to 1.1. // Delete from the webcal_report_template table and move the info // to the new webcal_user_template table. dbi_execute ( 'DELETE FROM webcal_report_template WHERE cal_template_type = ? AND cal_report_id = 0 ', array ($type ) ); } if ( ! dbi_execute ( $sql,$query_params ) ) $error = db_error (); else { echo ' Done '; exit; } } print_header ( '', '', '', true ); /* echo 'report_id: ' .$report_id . '
report_name: ' . $report_name . ' report_user: ' .$report_user . '
'; */ echo '

'; if ( $type == 'H' ) etranslate ( 'Edit Custom Header' ); elseif ($type == 'S' ) etranslate ( 'Edit Custom Script/Stylesheet' ); else etranslate ( 'Edit Custom Trailer' ); if ( $user != '__system__' ) { user_load_variables ($user, 'temp_' ); echo ' [' . $temp_fullname . ']'; } echo ' ' . ( ! empty ($error ) ? print_error ( $error ) : ' ' . ( ! empty ($ALLOW_USER_HEADER ) && $ALLOW_USER_HEADER == 'Y' && ! empty ($user ) && $user != '__system__' ? ' ' : '' ) . ' ' . ( ! empty ($user ) ? ' ' : '' ) . ' ' ) . "\n" . print_trailer ( false, true, true ); ?> 

     > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181  
\n"; else echo \$user; } else { echo '' . "\n"; `