每当我单击任何组或使用 phpldapadmin 工具呈现任何用户信息等时,我都会收到此错误。
PHP 致命错误:在第 40 行的 /usr/share/phpldapadmin/htdocs/template_engine.php 中找不到类“TemplateRender”
这是 template_engine.php 文件的内容:
1 <?php
2 /**
3 * Template render engine.
4 *
5 * @package phpLDAPadmin
6 * @subpackage Page
7 * @author The phpLDAPadmin development team
8 */
9
10 /**
11 The template engine has the following responsibilities:
12 * If we are passed a DN, then we are editing an existing entry
13 * If we are not passed a DN, then we are passed a container (and creating a new entry in that container)
14
15 In both cases, we are optionally passed a template ID.
16 * If we have a template ID, then we'll render the creation/editing using that template
17 * If we are not passed a template ID, then we'll either:
18 * Present a list of available templates,
19 * Present the default template, because there are non available (due to hidden,regexp or non-existant)
20 * Present the only template, if there is only one.
21
22 Creating and editing entries use two objects:
23 * A template object which describes how the template should be rendered (and what values should asked for, etc)
24 * A page object, which is responsible for actually sending out the HTML to the browser.
25
26 So:
27 * we init a new TemplateRender object
28 * we init a new Template object
29 * set the DN or container on the template object
30 * If setting the DN, this in turn should read the "old values" from the LDAP server
31 * If we are not on the first page (ie: 2nd, 3rd, 4th step, etc), we should accept the post values that we have obtained thus far
32
33 * Finally submit the update to "update_confirm", or the create to "create", when complete.
34 */
35
36 require './common.php';
37
38 $request = array();
39 $request['dn'] = get_request('dn','REQUEST');
40 $request['page'] = new TemplateRender($app['server']->getIndex(),get_request('template','REQUEST',false,null));
41
42 # If we have a DN, then this is to edit the entry.
43 if ($request['dn']) {
44 $app['server']->dnExists($request['dn'])
45 or error(sprintf('%s (%s)',_('No such entry'),pretty_print_dn($request['dn'])),'error','index.php');
46
47 $request['page']->setDN($request['dn']);
48 $request['page']->accept();
49
50 } else {
51 if ($app['server']->isReadOnly())
52 error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
53
54 $request['page']->setContainer(get_request('container','REQUEST'));
55 $request['page']->accept();
56 }
57 ?>