~ubuntu-branches/debian/jessie/phpldapadmin/jessie

« back to all changes in this revision

Viewing changes to htdocs/schema.php

  • Committer: Bazaar Package Importer
  • Author(s): Fabio Tranchitella
  • Date: 2009-03-16 14:54:15 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090316145415-7dsvj319dd02h83j
Tags: 1.1.0.6-1
* New upstream release. (Closes: #518578)
* debian/rules: removed "-m 644" from the dh_install call. (Closes: #518847)
* debian/postrm: remove config.php at purge time. (Closes: #519086)
* debian/patches/hungarian.dpatch: fixed a hungarian translation.
  (Closes: #505559)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
 
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/schema.php,v 1.67.2.4 2008/01/28 20:58:08 wurley Exp $
 
2
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/schema.php,v 1.67.2.7 2008/12/12 12:20:22 wurley Exp $
3
3
 
4
4
/**
5
5
 * Displays the schema for the specified server_id
17
17
require './common.php';
18
18
 
19
19
if (! $_SESSION[APPCONFIG]->isCommandAvailable('schema'))
20
 
        pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('view schema')));
 
20
        error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('view schema')),'error','index.php');
21
21
 
 
22
$entry = array();
22
23
$entry['view'] = get_request('view','GET','false','objectClasses');
23
24
$entry['value'] = get_request('viewvalue','GET');
24
25
 
63
64
switch($entry['view']) {
64
65
 
65
66
        case 'syntaxes':
66
 
                $highlight_oid = isset($_GET['highlight_oid']) ? $_GET['highlight_oid'] : false;
 
67
                $highlight_oid = get_request('highlight_oid','GET',false,false);
67
68
 
68
69
                echo '<center>';
69
70
                print '<table class="result_table" border=0>';
73
74
 
74
75
                $schema_syntaxes = $ldapserver->SchemaSyntaxes(null,true);
75
76
                if (! $schema_syntaxes)
76
 
                        pla_error($schema_error_str);
 
77
                        error($schema_error_str,'error','index.php');
77
78
 
78
79
                foreach ($schema_syntaxes as $syntax) {
79
80
                        $counter++;
108
109
                        'usage' => _('Usage'),
109
110
                        'maximum_length' => _('Maximum Length'),
110
111
                        'aliases' => _('Aliases'),
111
 
                        'used_by_objectclasses' => _('Used by objectClasses')
 
112
                        'used_by_objectclasses' => _('Used by objectClasses'),
 
113
                        'force_as_may' => _('Force as MAY by config')
112
114
                );
113
115
 
114
116
                $schema_attrs = $ldapserver->SchemaAttributes();
115
117
                $schema_object_classes = $ldapserver->SchemaObjectClasses();
116
118
 
117
119
                if (! $schema_attrs || ! $schema_object_classes)
118
 
                        pla_error($schema_error_str);
 
120
                        error($schema_error_str,'error','index.php');
119
121
 
120
122
                printf('<small>%s:</small>',_('Jump to an attribute type'));
121
123
                echo '<form action="cmd.php" method="get">';
279
281
                                                        print '</td>';
280
282
                                                        break;
281
283
 
 
284
                                                case 'force_as_may':
 
285
                                                        printf('<td>%s</td>',$attr->forced_as_may ? _('Yes') : _('No'));
 
286
                                                        break;
 
287
 
282
288
                                        }
283
289
                                        print '</tr>';
284
290
                                }
292
298
        case 'matching_rules':
293
299
                $schema_matching_rules = $ldapserver->MatchingRules(null,true);
294
300
                if (! $schema_matching_rules)
295
 
                        pla_error($schema_error_str);
 
301
                        error($schema_error_str,'error','index.php');
296
302
 
297
303
                printf('<small>%s</small><br />',_('Jump to a matching rule'));
298
304
 
371
377
        case 'objectClasses':
372
378
                $schema_oclasses = $ldapserver->SchemaObjectClasses();
373
379
                if (! $schema_oclasses)
374
 
                        pla_error($schema_error_str);
 
380
                        error($schema_error_str,'error','index.php');
375
381
 
376
382
                printf('<small>%s:</small>',_('Jump to an objectClass'));
377
383
 
485
491
                                                        $href = htmlspecialchars(sprintf($entry['href']['objectClasses'],strtolower($attr->getSource())));
486
492
                                                        printf('<small>(%s <a href="%s">%s</a>)</small>',_('Inherited from'),$href,$attr->getSource());
487
493
                                                }
 
494
 
 
495
                                                if ($oclass->isForceMay($attr->getName())) {
 
496
                                                        echo '<br />';
 
497
                                                        printf('<small>%s</small>',_('This attribute has been forced as a MAY attribute by the configuration'));
 
498
                                                }
488
499
                                                echo '</li>';
489
500
                                        }
490
501
                                        echo '</ul>';
502
513
}
503
514
 
504
515
if (! is_null($entry['value']) && ! $entry['viewed'])
505
 
        pla_error(sprintf(_('No such schema item: "%s"'),htmlspecialchars($entry['value'])));
 
516
        error(sprintf(_('No such schema item: "%s"'),htmlspecialchars($entry['value'])),'error','index.php');
506
517
?>