~ubuntu-branches/ubuntu/maverick/gallery2/maverick

« back to all changes in this revision

Viewing changes to modules/ecard/test/phpunit/EcardControllerTest.class

  • Committer: Bazaar Package Importer
  • Author(s): Michael C. Schultheiss
  • Date: 2007-09-10 20:22:19 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070910202219-0jsuntvqge4ade6b
Tags: 2.2.3-2
Add Slovak translation of Debconf templates.  (Thanks to 
Ivan Masá.  Closes: #441671)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/*
3
 
 * Gallery - a web based photo album viewer and editor
4
 
 * Copyright (C) 2000-2007 Bharat Mediratta
5
 
 *
6
 
 * This program is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; either version 2 of the License, or (at
9
 
 * your option) any later version.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful, but
12
 
 * WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 
 * General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, write to the Free Software
18
 
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.
19
 
 */
20
 
 
21
 
GalleryCoreApi::requireOnce('modules/core/classes/GalleryValidationPlugin.class');
22
 
 
23
 
/**
24
 
 * Test Ecard functionality
25
 
 * @package Ecard
26
 
 * @subpackage PHPUnit
27
 
 * @author Dariush Molavi <dari@nukedgallery.net>
28
 
 * @version $Revision: 15669 $
29
 
 */
30
 
class EcardControllerTest extends GalleryControllerTestCase {
31
 
 
32
 
    function EcardControllerTest($methodName) {
33
 
        $this->GalleryControllerTestCase($methodName, 'ecard.SendEcard');
34
 
    }
35
 
 
36
 
    function setUp() {
37
 
        global $gallery;
38
 
        parent::setUp();
39
 
 
40
 
        $ret = $this->_markPluginParametersForCleanup('module', 'ecard');
41
 
        if ($ret) {
42
 
            print $ret->getAsHtml();
43
 
            return $this->failWithStatus($ret);
44
 
        }
45
 
        $ret = GalleryCoreApi::setPluginParameter('module', 'ecard', 'validation.level', 'HIGH');
46
 
        if ($ret) {
47
 
            print $ret->getAsHtml();
48
 
            return $this->failWithStatus($ret);
49
 
        }
50
 
        $ret = GalleryCoreApi::setPluginParameter('module', 'ecard', 'subject', 'You got eCard');
51
 
        if ($ret) {
52
 
            print $ret->getAsHtml();
53
 
            return $this->failWithStatus($ret);
54
 
        }
55
 
 
56
 
        list ($ret, $this->_album) = $this->_createRandomAlbum($this->_getRootId());
57
 
        if ($ret) {
58
 
            print $ret->getAsHtml();
59
 
            return $this->failWithStatus($ret);
60
 
        }
61
 
        $this->_markForCleanup($this->_album);
62
 
 
63
 
        $ret = GalleryCoreApi::removeItemPermissions($this->_album->getId());
64
 
        if ($ret) {
65
 
            print $ret->getAsHtml();
66
 
            return $this->failWithStatus($ret);
67
 
        }
68
 
        $ret = GalleryCoreApi::addUserPermission(
69
 
                $this->_album->getId(), $gallery->getActiveUserId(), 'core.all');
70
 
        if ($ret) {
71
 
            print $ret->getAsHtml();
72
 
            return $this->failWithStatus($ret);
73
 
        }
74
 
        list ($ret, $this->_everybodyId) =
75
 
            GalleryCoreApi::getPluginParameter('module', 'core', 'id.everybodyGroup');
76
 
        if ($ret) {
77
 
            print $ret->getAsHtml();
78
 
            return $this->failWithStatus($ret);
79
 
        }
80
 
        $ret = GalleryCoreApi::addGroupPermission(
81
 
                $this->_album->getId(), $this->_everybodyId, 'core.view');
82
 
        if ($ret) {
83
 
            print $ret->getAsHtml();
84
 
            return $this->failWithStatus($ret);
85
 
        }
86
 
 
87
 
        $pathComponent = 'test-' . rand(1, 5000);
88
 
        $this->_itemFile = $pathComponent . '.dat';
89
 
        $this->_resizeFile = $pathComponent . '.jpg';
90
 
        list ($ret, $this->_item) = $this->_createRandomDataItem($this->_album->getId(),
91
 
                'application/unknown', array('pathComponent' => $this->_itemFile));
92
 
        if ($ret) {
93
 
            print $ret->getAsHtml();
94
 
            return $this->failWithStatus($ret);
95
 
        }
96
 
        list ($ret, $this->_resize) = $this->_createDerivative(
97
 
                $this->_item, $this->_item->getId(), DERIVATIVE_TYPE_IMAGE_RESIZE,
98
 
                'test-operation|100', 'image/jpeg', array('width' => 100, 'height' => 100));
99
 
        if ($ret) {
100
 
            print $ret->getAsHtml();
101
 
            return $this->failWithStatus($ret);
102
 
        }
103
 
 
104
 
        /* Make sure translate calls during test won't generate any platform calls */
105
 
        list ($ret) = GalleryCoreApi::getPermissionIds();
106
 
        if ($ret) {
107
 
            print $ret->getAsHtml();
108
 
            return $this->failWithStatus($ret);
109
 
        }
110
 
 
111
 
        $this->_platform = new UnitTestPlatform();
112
 
        $this->_controller->setPluginInstances(array());
113
 
    }
114
 
 
115
 
    function tearDown() {
116
 
        $this->assert($this->_platform->isComplete(), $this->_platform->getRemaining());
117
 
        parent::tearDown();
118
 
    }
119
 
 
120
 
    function testCancel() {
121
 
        $itemId = $this->_item->getId();
122
 
        GalleryUtilities::putRequestVariable('itemId', $itemId);
123
 
        GalleryUtilities::putRequestVariable('form[action][cancel]', 1);
124
 
 
125
 
        $results = $this->handleRequest();
126
 
 
127
 
        $this->assertEquals(array('redirect' => array('view' => 'core.ShowItem',
128
 
                                                      'itemId' => (int)$itemId),
129
 
                                  'status' => array(),
130
 
                                  'error' => array()),
131
 
                            $results);
132
 
    }
133
 
 
134
 
    function testMissingInputs() {
135
 
        $itemId = $this->_item->getId();
136
 
        GalleryUtilities::putRequestVariable('itemId', $itemId);
137
 
        GalleryUtilities::putRequestVariable('form[action][send]', 1);
138
 
 
139
 
        $results = $this->handleRequest();
140
 
        $this->assertEquals(
141
 
            array('delegate' => array('view' => 'ecard.SendEcard'),
142
 
                  'status' => array(),
143
 
                  'error' => array('form[error][to][missing]',
144
 
                                   'form[error][from][missing]',
145
 
                                   'form[error][text][missing]')),
146
 
            $results);
147
 
    }
148
 
 
149
 
    function testInvalidEmail() {
150
 
        $itemId = $this->_item->getId();
151
 
        GalleryUtilities::putRequestVariable('itemId', $itemId);
152
 
 
153
 
        GalleryUtilities::putRequestVariable('form[action][send]', 1);
154
 
        GalleryUtilities::putRequestVariable('form[from]', 'bad!email@test.com');
155
 
        GalleryUtilities::putRequestVariable('form[fromName]', 'Unit Tester');
156
 
        GalleryUtilities::putRequestVariable('form[to]', 'bad!email2@test.com');
157
 
        GalleryUtilities::putRequestVariable('form[text]', 'Test text');
158
 
 
159
 
        $results = $this->handleRequest();
160
 
        $this->assertEquals(
161
 
            array('delegate' => array('view' => 'ecard.SendEcard'),
162
 
                  'status' => array(),
163
 
                  'error' => array('form[error][to][invalid]', 'form[error][from][invalid]')),
164
 
            $results);
165
 
    }
166
 
 
167
 
    function testEcardNoSendPermission() {
168
 
        global $gallery;
169
 
        $itemId = $this->_item->getId();
170
 
        $ret = GalleryCoreApi::removeItemPermissions($itemId);
171
 
        if ($ret) {
172
 
            return $this->failWithStatus($ret);
173
 
        }
174
 
 
175
 
        GalleryUtilities::putRequestVariable('form[to]', 'example2@example.com');
176
 
        GalleryUtilities::putRequestVariable('form[from]', 'example@example.com');
177
 
        GalleryUtilities::putRequestVariable('form[fromName]', 'Unit Tester');
178
 
        GalleryUtilities::putRequestVariable('form[text]', 'Test email');
179
 
        GalleryUtilities::putRequestVariable('form[action][send]', 1);
180
 
        GalleryUtilities::putRequestVariable('itemId', $itemId);
181
 
 
182
 
        $gallery->setPlatform($this->_platform);
183
 
        $this->handleRequest(ERROR_PERMISSION_DENIED);
184
 
    }
185
 
 
186
 
    function testSendEcard() {
187
 
        global $gallery;
188
 
        $itemId = $this->_item->getId();
189
 
 
190
 
        /* Use html format and param specified 'from' for this test */
191
 
        $ret = GalleryCoreApi::setPluginParameter('module', 'ecard', 'format', 'html');
192
 
        if ($ret) {
193
 
            return $this->failWithStatus($ret);
194
 
        }
195
 
        $ret = GalleryCoreApi::setPluginParameter('module', 'ecard', 'from', 'eCard Test');
196
 
        if ($ret) {
197
 
            return $this->failWithStatus($ret);
198
 
        }
199
 
 
200
 
        $this->_platform->setReply('file_get_contents', array('fuzzy' => '/Message.txt/'),
201
 
                                   'The plaintext message: %text% %link%');
202
 
        $this->_platform->setReply('file_get_contents', array('fuzzy' => '/Message.html/'),
203
 
                                   'The html message: %text% %link% %image%');
204
 
        $this->_platform->setReply('mail', array(
205
 
                    'example2@example.com',
206
 
                    'You got eCard',
207
 
                    'fuzzy1' => '/plaintext message: Test < email http.*html '
208
 
                    . 'message: Test &lt; email http.* ' . $this->_resizeFile . '/s',
209
 
                    'fuzzy2' => '/From: eCard Test/'),
210
 
                true);
211
 
        $gallery->setPlatform($this->_platform);
212
 
 
213
 
        GalleryUtilities::putRequestVariable('form[to]', 'example2@example.com');
214
 
        GalleryUtilities::putRequestVariable('form[from]', 'example@example.com');
215
 
        GalleryUtilities::putRequestVariable('form[fromName]', 'Unit Tester');
216
 
        GalleryUtilities::putRequestVariable('form[text]', 'Test < email');
217
 
        GalleryUtilities::putRequestVariable('form[action][send]', 1);
218
 
        GalleryUtilities::putRequestVariable('itemId', $itemId);
219
 
 
220
 
        $results = $this->handleRequest();
221
 
 
222
 
        $this->assertEquals(
223
 
            array('redirect' => array('view' => 'ecard.Confirmation', 'itemId' => (int)$itemId),
224
 
                                      'status' => array('sent' => 1),
225
 
                                      'error' => array()),
226
 
                            $results, 'Failed to send ecard');
227
 
    }
228
 
 
229
 
    function testLinkPermission() {
230
 
        /* Verify that without public core.view permission, no link is included */
231
 
        global $gallery;
232
 
        $itemId = $this->_item->getId();
233
 
 
234
 
        $ret = GalleryCoreApi::removeGroupPermission($itemId, $this->_everybodyId, 'core.view');
235
 
        if ($ret) {
236
 
            return $this->failWithStatus($ret);
237
 
        }
238
 
 
239
 
        /* Use html format and param specified 'from' for this test */
240
 
        $ret = GalleryCoreApi::setPluginParameter('module', 'ecard', 'format', 'html');
241
 
        if ($ret) {
242
 
            return $this->failWithStatus($ret);
243
 
        }
244
 
        $ret = GalleryCoreApi::setPluginParameter('module', 'ecard', 'from', 'eCard Test');
245
 
        if ($ret) {
246
 
            return $this->failWithStatus($ret);
247
 
        }
248
 
 
249
 
        $this->_platform->setReply('file_get_contents', array('fuzzy' => '/Message.txt/'),
250
 
                                   'The plaintext message: %text% %link%');
251
 
        $this->_platform->setReply('file_get_contents', array('fuzzy' => '/Message.html/'),
252
 
                                   'The html message: %text% %link% %image%');
253
 
        $this->_platform->setReply('mail', array(
254
 
                    'example2@example.com',
255
 
                    'You got eCard',
256
 
                    'fuzzy1' => '/plaintext message: Test < email [^h].*html message: Test &lt; '
257
 
                    . 'email  ' . $this->_resizeFile . '/s',
258
 
                    'fuzzy2' => '/From: eCard Test/'),
259
 
                true);
260
 
        $gallery->setPlatform($this->_platform);
261
 
 
262
 
        GalleryUtilities::putRequestVariable('form[to]', 'example2@example.com');
263
 
        GalleryUtilities::putRequestVariable('form[from]', 'example@example.com');
264
 
        GalleryUtilities::putRequestVariable('form[fromName]', 'Unit Tester');
265
 
        GalleryUtilities::putRequestVariable('form[text]', 'Test < email');
266
 
        GalleryUtilities::putRequestVariable('form[action][send]', 1);
267
 
        GalleryUtilities::putRequestVariable('itemId', $itemId);
268
 
 
269
 
        $results = $this->handleRequest();
270
 
 
271
 
        $this->assertEquals(
272
 
            array('redirect' => array('view' => 'ecard.Confirmation', 'itemId' => (int)$itemId),
273
 
                                      'status' => array('sent' => 1),
274
 
                                      'error' => array()),
275
 
                            $results, 'Failed to send ecard');
276
 
    }
277
 
 
278
 
    function testSizePermission() {
279
 
        /* Verify permission check for size of image included in email */
280
 
        global $gallery;
281
 
        $itemId = $this->_item->getId();
282
 
 
283
 
        $ret = GalleryCoreApi::removeUserPermission(
284
 
                $itemId, $gallery->getActiveUserId(), 'core.viewResizes');
285
 
        if ($ret) {
286
 
            return $this->failWithStatus($ret);
287
 
        }
288
 
 
289
 
        /* Use plain format and param specified 'from' for this test */
290
 
        $ret = GalleryCoreApi::setPluginParameter('module', 'ecard', 'format', 'plain');
291
 
        if ($ret) {
292
 
            return $this->failWithStatus($ret);
293
 
        }
294
 
        $ret = GalleryCoreApi::setPluginParameter('module', 'ecard', 'from', 'eCard Test');
295
 
        if ($ret) {
296
 
            return $this->failWithStatus($ret);
297
 
        }
298
 
 
299
 
        $this->_platform->setReply('getDirectorySeparator', array(), '/');
300
 
        $this->_platform->setReply('file_get_contents', array('fuzzy' => '/Message.txt/'),
301
 
                                   'message: %image%');
302
 
        $this->_platform->setReply('mail', array(
303
 
                    'example2@example.com',
304
 
                    'You got eCard',
305
 
                    'fuzzy1' => '/message: ' . $this->_itemFile . '/s',
306
 
                    'fuzzy2' => '/From: eCard Test/'),
307
 
                true);
308
 
        $gallery->setPlatform($this->_platform);
309
 
 
310
 
        GalleryUtilities::putRequestVariable('form[to]', 'example2@example.com');
311
 
        GalleryUtilities::putRequestVariable('form[from]', 'example@example.com');
312
 
        GalleryUtilities::putRequestVariable('form[fromName]', 'Unit Tester');
313
 
        GalleryUtilities::putRequestVariable('form[text]', 'Test < email');
314
 
        GalleryUtilities::putRequestVariable('form[action][send]', 1);
315
 
        GalleryUtilities::putRequestVariable('itemId', $itemId);
316
 
 
317
 
        $results = $this->handleRequest();
318
 
 
319
 
        $this->assertEquals(
320
 
            array('redirect' => array('view' => 'ecard.Confirmation', 'itemId' => (int)$itemId),
321
 
                                      'status' => array('sent' => 1),
322
 
                                      'error' => array()),
323
 
                            $results, 'Failed to send ecard');
324
 
    }
325
 
 
326
 
    function testValidationPlugin() {
327
 
        global $gallery;
328
 
        $this->_controller->_pluginInstances = array(new AddEcardTestValidation());
329
 
 
330
 
        $this->_becomeGuestUser();
331
 
        $ret = GalleryCoreApi::addUserPermission($this->_item->getId(),
332
 
                                                 $gallery->getActiveUserId(), 'ecard.send');
333
 
        if ($ret) {
334
 
            return $this->failWithStatus($ret);
335
 
        }
336
 
 
337
 
        $gallery->setPlatform($this->_platform);
338
 
 
339
 
        GalleryUtilities::putRequestVariable('itemId', $this->_item->getId());
340
 
        GalleryUtilities::putRequestVariable('form[to]', 'example2@example.com');
341
 
        GalleryUtilities::putRequestVariable('form[from]', 'example@example.com');
342
 
        GalleryUtilities::putRequestVariable('form[fromName]', 'Unit Tester');
343
 
        GalleryUtilities::putRequestVariable('form[text]', 'Test email');
344
 
        GalleryUtilities::putRequestVariable('form[action][send]', 1);
345
 
 
346
 
        /* Perform the request and verify validation plugin got error */
347
 
        $results = $this->handleRequest();
348
 
        $this->assertEquals(array('delegate' => array('view' => 'ecard.SendEcard'),
349
 
                                  'status' => array(),
350
 
                                  'error' => array('form[error][AddEcardTestValidation]')),
351
 
                            $results);
352
 
    }
353
 
 
354
 
    function testValidationAlternateGuest() {
355
 
        global $gallery;
356
 
        $gallery->setConfig('anonymousUserId', $gallery->getActiveUserId());
357
 
        $this->_controller->_pluginInstances = array(new AddEcardTestValidation());
358
 
        $gallery->setPlatform($this->_platform);
359
 
 
360
 
        GalleryUtilities::putRequestVariable('itemId', $this->_item->getId());
361
 
        GalleryUtilities::putRequestVariable('form[to]', 'example2@example.com');
362
 
        GalleryUtilities::putRequestVariable('form[from]', 'example@example.com');
363
 
        GalleryUtilities::putRequestVariable('form[fromName]', 'Unit Tester');
364
 
        GalleryUtilities::putRequestVariable('form[text]', 'Test email');
365
 
        GalleryUtilities::putRequestVariable('form[action][send]', 1);
366
 
 
367
 
        /* Perform the request and verify validation plugin got error */
368
 
        $results = $this->handleRequest();
369
 
        $this->assertEquals(array('delegate' => array('view' => 'ecard.SendEcard'),
370
 
                                  'status' => array(),
371
 
                                  'error' => array('form[error][AddEcardTestValidation]')),
372
 
                            $results);
373
 
    }
374
 
 
375
 
    function testValidationPluginOff() {
376
 
        global $gallery;
377
 
        $this->_controller->_pluginInstances = array(new AddEcardTestValidation());
378
 
 
379
 
        $ret = GalleryCoreApi::setPluginParameter('module', 'ecard', 'validation.level', 'OFF');
380
 
        if ($ret) {
381
 
            return $this->failWithStatus($ret);
382
 
        }
383
 
        /* Use plain format and form specified 'from' for this test */
384
 
        $ret = GalleryCoreApi::setPluginParameter('module', 'ecard', 'format', 'plain');
385
 
        if ($ret) {
386
 
            return $this->failWithStatus($ret);
387
 
        }
388
 
        $ret = GalleryCoreApi::setPluginParameter('module', 'ecard', 'from', '');
389
 
        if ($ret) {
390
 
            return $this->failWithStatus($ret);
391
 
        }
392
 
 
393
 
        $this->_becomeGuestUser();
394
 
        $ret = GalleryCoreApi::addUserPermission($this->_item->getId(),
395
 
                                                 $gallery->getActiveUserId(), 'ecard.send');
396
 
        if ($ret) {
397
 
            return $this->failWithStatus($ret);
398
 
        }
399
 
        $ret = GalleryCoreApi::addGroupPermission(
400
 
                $this->_item->getId(), $this->_everybodyId, 'core.viewResizes');
401
 
        if ($ret) {
402
 
            return $this->failWithStatus($ret);
403
 
        }
404
 
 
405
 
        $this->_platform->setReply('file_get_contents', array('fuzzy' => '/Message.txt/'),
406
 
                                   'The plaintext message: %text%');
407
 
        $this->_platform->setReply('mail', array(
408
 
                    'example2@example.com',
409
 
                    'You got eCard',
410
 
                    'fuzzy1' => '/plaintext.*Test "email"(?!.*html message)/s',
411
 
                    'fuzzy2' => '/From: Unit Tester <example@example.com>/'),
412
 
                true);
413
 
        $gallery->setPlatform($this->_platform);
414
 
 
415
 
        GalleryUtilities::putRequestVariable('itemId', $this->_item->getId());
416
 
        GalleryUtilities::putRequestVariable('form[to]', 'example2@example.com');
417
 
        GalleryUtilities::putRequestVariable('form[from]', 'example@example.com');
418
 
        GalleryUtilities::putRequestVariable('form[fromName]', 'Unit Tester');
419
 
        GalleryUtilities::putRequestVariable('form[text]', 'Test &quot;email&quot;');
420
 
        GalleryUtilities::putRequestVariable('form[action][send]', 1);
421
 
 
422
 
        /* Perform the request and eCard sent (validation plugin skipped) */
423
 
        $results = $this->handleRequest();
424
 
        $this->assertEquals(
425
 
            array('redirect' => array('view' => 'ecard.Confirmation',
426
 
                                      'itemId' => (int)$this->_item->getId()),
427
 
                                  'status' => array('sent' => 1),
428
 
                                  'error' => array()),
429
 
                            $results, 'Failed to send ecard');
430
 
    }
431
 
 
432
 
    function testMaliciousContent() {
433
 
        /*
434
 
         * Verify even in html markup mode, we don't send any user entered html.
435
 
         * (if this changes then we'll need to use htmlSafe on content)
436
 
         */
437
 
        global $gallery;
438
 
        $itemId = $this->_item->getId();
439
 
 
440
 
        $ret = $this->_setMarkupType('html', true);
441
 
        if ($ret) {
442
 
            return $this->failWithStatus($ret);
443
 
        }
444
 
        $ret = GalleryCoreApi::setPluginParameter('module', 'ecard', 'format', 'html');
445
 
        if ($ret) {
446
 
            return $this->failWithStatus($ret);
447
 
        }
448
 
        $ret = GalleryCoreApi::setPluginParameter('module', 'ecard', 'from', 'Bad eCard');
449
 
        if ($ret) {
450
 
            return $this->failWithStatus($ret);
451
 
        }
452
 
 
453
 
        $this->_platform->setReply('file_get_contents', array('fuzzy' => '/Message.txt/'),
454
 
                                   'The plaintext message: %text%');
455
 
        $this->_platform->setReply('file_get_contents', array('fuzzy' => '/Message.html/'),
456
 
                                   'The html message: %text%');
457
 
        $this->_platform->setReply('mail', array(
458
 
                    'sucker@example.com',
459
 
                    'You got eCard',
460
 
                    'fuzzy1' => '/plaintext message: Hi <script>alert.*' .
461
 
                                'html message: Hi &lt;script&gt;alert/s',
462
 
                    'fuzzy2' => '/From: Bad eCard/'),
463
 
                true);
464
 
        $gallery->setPlatform($this->_platform);
465
 
 
466
 
        GalleryUtilities::putRequestVariable('form[to]', 'sucker@example.com');
467
 
        GalleryUtilities::putRequestVariable('form[from]', 'hacker@example.com');
468
 
        GalleryUtilities::putRequestVariable('form[text]', 'Hi <script>alert(1);</script> friend');
469
 
        GalleryUtilities::putRequestVariable('form[action][send]', 1);
470
 
        GalleryUtilities::putRequestVariable('itemId', $itemId);
471
 
 
472
 
        $results = $this->handleRequest();
473
 
        $this->assertEquals(
474
 
            array('redirect' => array('view' => 'ecard.Confirmation', 'itemId' => (int)$itemId),
475
 
                                      'status' => array('sent' => 1),
476
 
                                      'error' => array()),
477
 
                            $results, 'Failed to send ecard');
478
 
    }
479
 
}
480
 
 
481
 
GalleryCoreApi::requireOnce('modules/core/classes/GalleryValidationPlugin.class');
482
 
class AddEcardTestValidation extends GalleryValidationPlugin {
483
 
    function performValidation(&$form, $options=array()) {
484
 
        return array(null,
485
 
                     array('form[error][AddEcardTestValidation]'), false);
486
 
    }
487
 
}
488
 
?>