xref: /plugin/gitbacked/action/editcommit.php (revision dee8dca12468216679c058a7a0a707e74e351cfa)
1fa53f2a3SWolfgang Gassler<?php
2fa53f2a3SWolfgang Gassler/**
3fa53f2a3SWolfgang Gassler * DokuWiki Plugin gitbacked (Action Component)
4fa53f2a3SWolfgang Gassler *
5fa53f2a3SWolfgang Gassler * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6fa53f2a3SWolfgang Gassler * @author  Wolfgang Gassler <wolfgang@gassler.org>
7fa53f2a3SWolfgang Gassler */
8fa53f2a3SWolfgang Gassler
9fa53f2a3SWolfgang Gassler// must be run within Dokuwiki
10fa53f2a3SWolfgang Gasslerif (!defined('DOKU_INC')) die();
11fa53f2a3SWolfgang Gassler
12fa53f2a3SWolfgang Gasslerif (!defined('DOKU_LF')) define('DOKU_LF', "\n");
13fa53f2a3SWolfgang Gasslerif (!defined('DOKU_TAB')) define('DOKU_TAB', "\t");
14fa53f2a3SWolfgang Gasslerif (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
15fa53f2a3SWolfgang Gassler
16fa53f2a3SWolfgang Gasslerrequire_once DOKU_PLUGIN.'action.php';
1700ce3f12SDanny Linrequire_once dirname(__FILE__).'/../lib/Git.php';
18*dee8dca1SMarkus Hoffroggerequire_once dirname(__FILE__).'/../lib/GitBackedUtil.php';
19fa53f2a3SWolfgang Gassler
20fa53f2a3SWolfgang Gasslerclass action_plugin_gitbacked_editcommit extends DokuWiki_Action_Plugin {
21fa53f2a3SWolfgang Gassler
2200ce3f12SDanny Lin    function __construct() {
2300ce3f12SDanny Lin        global $conf;
2400ce3f12SDanny Lin        $this->temp_dir = $conf['tmpdir'].'/gitbacked';
2500ce3f12SDanny Lin        io_mkdir_p($this->temp_dir);
2600ce3f12SDanny Lin    }
2700ce3f12SDanny Lin
28a6cdc68cSMichael Sorg    public function register(Doku_Event_Handler $controller) {
29fa53f2a3SWolfgang Gassler
30fa53f2a3SWolfgang Gassler        $controller->register_hook('IO_WIKIPAGE_WRITE', 'AFTER', $this, 'handle_io_wikipage_write');
31442c3981SWolfgang Gassler        $controller->register_hook('MEDIA_UPLOAD_FINISH', 'AFTER', $this, 'handle_media_upload');
32442c3981SWolfgang Gassler        $controller->register_hook('MEDIA_DELETE_FILE', 'AFTER', $this, 'handle_media_deletion');
33b92b117aSWolfgang Gassler        $controller->register_hook('DOKUWIKI_DONE', 'AFTER', $this, 'handle_periodic_pull');
34442c3981SWolfgang Gassler    }
35442c3981SWolfgang Gassler
36b92b117aSWolfgang Gassler    private function initRepo() {
37442c3981SWolfgang Gassler        //get path to the repo root (by default DokuWiki's savedir)
38*dee8dca1SMarkus Hoffrogge        $repoPath = GitBackedUtil::getEffectivePath($this->getConf('repoPath'));
39635161d0SCarsten Teibes        $gitPath = trim($this->getConf('gitPath'));
40635161d0SCarsten Teibes        if ($gitPath !== '') {
41635161d0SCarsten Teibes            Git::set_bin($gitPath);
42635161d0SCarsten Teibes        }
43442c3981SWolfgang Gassler        //init the repo and create a new one if it is not present
444eba9b44SDanny Lin        io_mkdir_p($repoPath);
45e8224fc2SMarkus Hoffrogge        $repo = new GitRepo($repoPath, $this, true, true);
464eba9b44SDanny Lin        //set git working directory (by default DokuWiki's savedir)
47*dee8dca1SMarkus Hoffrogge        $repoWorkDir = $this->getConf('repoWorkDir');
48*dee8dca1SMarkus Hoffrogge        if (!empty($repoWorkDir)) {
49*dee8dca1SMarkus Hoffrogge            $repoWorkDir = GitBackedUtil::getEffectivePath($repoWorkDir);
50*dee8dca1SMarkus Hoffrogge        }
51*dee8dca1SMarkus Hoffrogge        Git::set_bin(empty($repoWorkDir) ? Git::get_bin() : Git::get_bin().' --work-tree '.escapeshellarg($repoWorkDir));
520d7cb616SBirkir A. Barkarson        $params = str_replace(
530d7cb616SBirkir A. Barkarson            array('%mail%','%user%'),
540d7cb616SBirkir A. Barkarson            array($this->getAuthorMail(),$this->getAuthor()),
550d7cb616SBirkir A. Barkarson            $this->getConf('addParams'));
56442c3981SWolfgang Gassler        if ($params) {
57985a1bc7SCarsten Teibes            Git::set_bin(Git::get_bin().' '.$params);
58442c3981SWolfgang Gassler        }
59b92b117aSWolfgang Gassler        return $repo;
60b92b117aSWolfgang Gassler    }
61b92b117aSWolfgang Gassler
6266f21a70SWolfgang Gassler	private function isIgnored($filePath) {
6366f21a70SWolfgang Gassler		$ignore = false;
6466f21a70SWolfgang Gassler		$ignorePaths = trim($this->getConf('ignorePaths'));
6566f21a70SWolfgang Gassler		if ($ignorePaths !== '') {
6666f21a70SWolfgang Gassler			$paths = explode(',',$ignorePaths);
6766f21a70SWolfgang Gassler			foreach($paths as $path) {
6866f21a70SWolfgang Gassler				if (strstr($filePath,$path)) {
6966f21a70SWolfgang Gassler					$ignore = true;
7066f21a70SWolfgang Gassler				}
7166f21a70SWolfgang Gassler			}
7266f21a70SWolfgang Gassler		}
7366f21a70SWolfgang Gassler		return $ignore;
7466f21a70SWolfgang Gassler	}
7566f21a70SWolfgang Gassler
76b92b117aSWolfgang Gassler    private function commitFile($filePath,$message) {
7766f21a70SWolfgang Gassler		if (!$this->isIgnored($filePath)) {
78e8224fc2SMarkus Hoffrogge			try {
79b92b117aSWolfgang Gassler				$repo = $this->initRepo();
80442c3981SWolfgang Gassler
81442c3981SWolfgang Gassler				//add the changed file and set the commit message
82442c3981SWolfgang Gassler				$repo->add($filePath);
83442c3981SWolfgang Gassler				$repo->commit($message);
84442c3981SWolfgang Gassler
85442c3981SWolfgang Gassler				//if the push after Commit option is set we push the active branch to origin
86442c3981SWolfgang Gassler				if ($this->getConf('pushAfterCommit')) {
87442c3981SWolfgang Gassler					$repo->push('origin',$repo->active_branch());
88442c3981SWolfgang Gassler				}
89e8224fc2SMarkus Hoffrogge			} catch (Exception $e) {
90e8224fc2SMarkus Hoffrogge				if (!$this->isNotifyByEmailOnGitCommandError()) {
91e8224fc2SMarkus Hoffrogge					throw new Exception('Git committing or pushing failed: '.$e->getMessage(), 1, $e);
9266f21a70SWolfgang Gassler				}
93e8224fc2SMarkus Hoffrogge				return;
94e8224fc2SMarkus Hoffrogge			}
95e8224fc2SMarkus Hoffrogge		}
96442c3981SWolfgang Gassler    }
97442c3981SWolfgang Gassler
98442c3981SWolfgang Gassler    private function getAuthor() {
99442c3981SWolfgang Gassler        return $GLOBALS['USERINFO']['name'];
100442c3981SWolfgang Gassler    }
101442c3981SWolfgang Gassler
1020d7cb616SBirkir A. Barkarson    private function getAuthorMail() {
1030d7cb616SBirkir A. Barkarson        return $GLOBALS['USERINFO']['mail'];
1040d7cb616SBirkir A. Barkarson    }
1050d7cb616SBirkir A. Barkarson
1062377428fSDanny Lin    public function handle_periodic_pull(Doku_Event &$event, $param) {
1072377428fSDanny Lin        if ($this->getConf('periodicPull')) {
1082377428fSDanny Lin            $lastPullFile = $this->temp_dir.'/lastpull.txt';
1092377428fSDanny Lin            //check if the lastPullFile exists
1102377428fSDanny Lin            if (is_file($lastPullFile)) {
1112377428fSDanny Lin                $lastPull = unserialize(file_get_contents($lastPullFile));
1122377428fSDanny Lin            } else {
1132377428fSDanny Lin                $lastPull = 0;
1142377428fSDanny Lin            }
1152377428fSDanny Lin            //calculate time between pulls in seconds
1162377428fSDanny Lin            $timeToWait = $this->getConf('periodicMinutes')*60;
1172377428fSDanny Lin            $now = time();
1182377428fSDanny Lin
1192377428fSDanny Lin            //if it is time to run a pull request
1202377428fSDanny Lin            if ($lastPull+$timeToWait < $now) {
121e8224fc2SMarkus Hoffrogge				try {
1222377428fSDanny Lin                	$repo = $this->initRepo();
1232377428fSDanny Lin
1242377428fSDanny Lin                	//execute the pull request
1252377428fSDanny Lin                	$repo->pull('origin',$repo->active_branch());
126e8224fc2SMarkus Hoffrogge				} catch (Exception $e) {
127e8224fc2SMarkus Hoffrogge					if (!$this->isNotifyByEmailOnGitCommandError()) {
128e8224fc2SMarkus Hoffrogge						throw new Exception('Git command failed to perform periodic pull: '.$e->getMessage(), 2, $e);
129e8224fc2SMarkus Hoffrogge					}
130e8224fc2SMarkus Hoffrogge					return;
131e8224fc2SMarkus Hoffrogge				}
1322377428fSDanny Lin
1332377428fSDanny Lin                //save the current time to the file to track the last pull execution
1342377428fSDanny Lin                file_put_contents($lastPullFile,serialize(time()));
1352377428fSDanny Lin            }
1362377428fSDanny Lin        }
1372377428fSDanny Lin    }
1382377428fSDanny Lin
139442c3981SWolfgang Gassler    public function handle_media_deletion(Doku_Event &$event, $param) {
140442c3981SWolfgang Gassler        $mediaPath = $event->data['path'];
141442c3981SWolfgang Gassler        $mediaName = $event->data['name'];
142442c3981SWolfgang Gassler
143442c3981SWolfgang Gassler        $message = str_replace(
144442c3981SWolfgang Gassler            array('%media%','%user%'),
145442c3981SWolfgang Gassler            array($mediaName,$this->getAuthor()),
146442c3981SWolfgang Gassler            $this->getConf('commitMediaMsgDel')
147442c3981SWolfgang Gassler        );
148442c3981SWolfgang Gassler
149442c3981SWolfgang Gassler        $this->commitFile($mediaPath,$message);
150442c3981SWolfgang Gassler
151442c3981SWolfgang Gassler    }
152442c3981SWolfgang Gassler
153442c3981SWolfgang Gassler    public function handle_media_upload(Doku_Event &$event, $param) {
154442c3981SWolfgang Gassler
155442c3981SWolfgang Gassler        $mediaPath = $event->data[1];
156442c3981SWolfgang Gassler        $mediaName = $event->data[2];
157442c3981SWolfgang Gassler
158442c3981SWolfgang Gassler        $message = str_replace(
159442c3981SWolfgang Gassler            array('%media%','%user%'),
160442c3981SWolfgang Gassler            array($mediaName,$this->getAuthor()),
161442c3981SWolfgang Gassler            $this->getConf('commitMediaMsg')
162442c3981SWolfgang Gassler        );
163442c3981SWolfgang Gassler
164442c3981SWolfgang Gassler        $this->commitFile($mediaPath,$message);
165fa53f2a3SWolfgang Gassler
166fa53f2a3SWolfgang Gassler    }
167fa53f2a3SWolfgang Gassler
168fa53f2a3SWolfgang Gassler    public function handle_io_wikipage_write(Doku_Event &$event, $param) {
169fa53f2a3SWolfgang Gassler
170fa53f2a3SWolfgang Gassler        $rev = $event->data[3];
171fa53f2a3SWolfgang Gassler
172fa53f2a3SWolfgang Gassler        /* On update to an existing page this event is called twice,
173fa53f2a3SWolfgang Gassler         * once for the transfer of the old version to the attic (rev will have a value)
174fa53f2a3SWolfgang Gassler         * and once to write the new version of the page into the wiki (rev is false)
175fa53f2a3SWolfgang Gassler         */
176fa53f2a3SWolfgang Gassler        if (!$rev) {
177fa53f2a3SWolfgang Gassler
178fa53f2a3SWolfgang Gassler            $pagePath = $event->data[0][0];
179fa53f2a3SWolfgang Gassler            $pageName = $event->data[2];
180442c3981SWolfgang Gassler            $pageContent = $event->data[0][1];
181fa53f2a3SWolfgang Gassler
1827af27dc9SWolfgang Gassler            // get the summary directly from the form input
183e7471cfaSDanny Lin            // as the metadata hasn't updated yet
1847af27dc9SWolfgang Gassler            $editSummary = $GLOBALS['INPUT']->str('summary');
185442c3981SWolfgang Gassler
186442c3981SWolfgang Gassler            // empty content indicates a page deletion
187442c3981SWolfgang Gassler            if ($pageContent == '') {
188442c3981SWolfgang Gassler                // get the commit text for deletions
189d4e1c54bSWolfgang Gassler                $msgTemplate = $this->getConf('commitPageMsgDel');
190442c3981SWolfgang Gassler
191442c3981SWolfgang Gassler                // bad hack as DokuWiki deletes the file after this event
192442c3981SWolfgang Gassler                // thus, let's delete the file by ourselves, so git can recognize the deletion
193442c3981SWolfgang Gassler                // DokuWiki uses @unlink as well, so no error should be thrown if we delete it twice
194442c3981SWolfgang Gassler                @unlink($pagePath);
195442c3981SWolfgang Gassler
196442c3981SWolfgang Gassler            } else {
197442c3981SWolfgang Gassler                //get the commit text for edits
198d4e1c54bSWolfgang Gassler                $msgTemplate = $this->getConf('commitPageMsg');
199442c3981SWolfgang Gassler            }
200442c3981SWolfgang Gassler
201fa53f2a3SWolfgang Gassler            $message = str_replace(
202fa53f2a3SWolfgang Gassler                array('%page%','%summary%','%user%'),
203442c3981SWolfgang Gassler                array($pageName,$editSummary,$this->getAuthor()),
204442c3981SWolfgang Gassler                $msgTemplate
205fa53f2a3SWolfgang Gassler            );
206fa53f2a3SWolfgang Gassler
207442c3981SWolfgang Gassler            $this->commitFile($pagePath,$message);
208fa53f2a3SWolfgang Gassler
209fa53f2a3SWolfgang Gassler        }
210e8224fc2SMarkus Hoffrogge    }
211fa53f2a3SWolfgang Gassler
212e8224fc2SMarkus Hoffrogge	// ====== Error notification helpers ======
213e8224fc2SMarkus Hoffrogge	/**
214e8224fc2SMarkus Hoffrogge	 * Notifies error on create_new
215e8224fc2SMarkus Hoffrogge	 *
216e8224fc2SMarkus Hoffrogge	 * @access  public
217e8224fc2SMarkus Hoffrogge	 * @param   string  repository path
218e8224fc2SMarkus Hoffrogge	 * @param   string  reference path / remote reference
219e8224fc2SMarkus Hoffrogge	 * @param   string  error message
220e8224fc2SMarkus Hoffrogge	 * @return  bool
221e8224fc2SMarkus Hoffrogge	 */
222e8224fc2SMarkus Hoffrogge	public function notify_create_new_error($repo_path, $reference, $error_message) {
223e8224fc2SMarkus Hoffrogge		$template_replacements = array(
224e8224fc2SMarkus Hoffrogge			'GIT_REPO_PATH' => $repo_path,
225e8224fc2SMarkus Hoffrogge			'GIT_REFERENCE' => (empty($reference) ? 'n/a' : $reference),
226e8224fc2SMarkus Hoffrogge			'GIT_ERROR_MESSAGE' => $error_message
227e8224fc2SMarkus Hoffrogge		);
228e8224fc2SMarkus Hoffrogge		return $this->notifyByMail('mail_create_new_error_subject', 'mail_create_new_error', $template_replacements);
229e8224fc2SMarkus Hoffrogge	}
230e8224fc2SMarkus Hoffrogge
231e8224fc2SMarkus Hoffrogge	/**
232e8224fc2SMarkus Hoffrogge	 * Notifies error on setting repo path
233e8224fc2SMarkus Hoffrogge	 *
234e8224fc2SMarkus Hoffrogge	 * @access  public
235e8224fc2SMarkus Hoffrogge	 * @param   string  repository path
236e8224fc2SMarkus Hoffrogge	 * @param   string  error message
237e8224fc2SMarkus Hoffrogge	 * @return  bool
238e8224fc2SMarkus Hoffrogge	 */
239e8224fc2SMarkus Hoffrogge	public function notify_repo_path_error($repo_path, $error_message) {
240e8224fc2SMarkus Hoffrogge		$template_replacements = array(
241e8224fc2SMarkus Hoffrogge			'GIT_REPO_PATH' => $repo_path,
242e8224fc2SMarkus Hoffrogge			'GIT_ERROR_MESSAGE' => $error_message
243e8224fc2SMarkus Hoffrogge		);
244e8224fc2SMarkus Hoffrogge		return $this->notifyByMail('mail_repo_path_error_subject', 'mail_repo_path_error', $template_replacements);
245e8224fc2SMarkus Hoffrogge	}
246e8224fc2SMarkus Hoffrogge
247e8224fc2SMarkus Hoffrogge	/**
248e8224fc2SMarkus Hoffrogge	 * Notifies error on git command
249e8224fc2SMarkus Hoffrogge	 *
250e8224fc2SMarkus Hoffrogge	 * @access  public
251e8224fc2SMarkus Hoffrogge	 * @param   string  repository path
252e8224fc2SMarkus Hoffrogge	 * @param   string  current working dir
253e8224fc2SMarkus Hoffrogge	 * @param   string  command line
254e8224fc2SMarkus Hoffrogge	 * @param   int     exit code of command (status)
255e8224fc2SMarkus Hoffrogge	 * @param   string  error message
256e8224fc2SMarkus Hoffrogge	 * @return  bool
257e8224fc2SMarkus Hoffrogge	 */
258e8224fc2SMarkus Hoffrogge	public function notify_command_error($repo_path, $cwd, $command, $status, $error_message) {
259e8224fc2SMarkus Hoffrogge		$template_replacements = array(
260e8224fc2SMarkus Hoffrogge			'GIT_REPO_PATH' => $repo_path,
261e8224fc2SMarkus Hoffrogge			'GIT_CWD' => $cwd,
262e8224fc2SMarkus Hoffrogge			'GIT_COMMAND' => $command,
263e8224fc2SMarkus Hoffrogge			'GIT_COMMAND_EXITCODE' => $status,
264e8224fc2SMarkus Hoffrogge			'GIT_ERROR_MESSAGE' => $error_message
265e8224fc2SMarkus Hoffrogge		);
266e8224fc2SMarkus Hoffrogge		return $this->notifyByMail('mail_command_error_subject', 'mail_command_error', $template_replacements);
267e8224fc2SMarkus Hoffrogge	}
268e8224fc2SMarkus Hoffrogge
269e8224fc2SMarkus Hoffrogge	/**
270e8224fc2SMarkus Hoffrogge	 * Notifies success on git command
271e8224fc2SMarkus Hoffrogge	 *
272e8224fc2SMarkus Hoffrogge	 * @access  public
273e8224fc2SMarkus Hoffrogge	 * @param   string  repository path
274e8224fc2SMarkus Hoffrogge	 * @param   string  current working dir
275e8224fc2SMarkus Hoffrogge	 * @param   string  command line
276e8224fc2SMarkus Hoffrogge	 * @return  bool
277e8224fc2SMarkus Hoffrogge	 */
278e8224fc2SMarkus Hoffrogge	public function notify_command_success($repo_path, $cwd, $command) {
279e8224fc2SMarkus Hoffrogge		if (!$this->getConf('notifyByMailOnSuccess')) {
280e8224fc2SMarkus Hoffrogge			return false;
281e8224fc2SMarkus Hoffrogge		}
282e8224fc2SMarkus Hoffrogge		$template_replacements = array(
283e8224fc2SMarkus Hoffrogge			'GIT_REPO_PATH' => $repo_path,
284e8224fc2SMarkus Hoffrogge			'GIT_CWD' => $cwd,
285e8224fc2SMarkus Hoffrogge			'GIT_COMMAND' => $command
286e8224fc2SMarkus Hoffrogge		);
287e8224fc2SMarkus Hoffrogge		return $this->notifyByMail('mail_command_success_subject', 'mail_command_success', $template_replacements);
288e8224fc2SMarkus Hoffrogge	}
289e8224fc2SMarkus Hoffrogge
290e8224fc2SMarkus Hoffrogge	/**
291e8224fc2SMarkus Hoffrogge	 * Send an eMail, if eMail address is configured
292e8224fc2SMarkus Hoffrogge	 *
293e8224fc2SMarkus Hoffrogge	 * @access  public
294e8224fc2SMarkus Hoffrogge	 * @param   string  lang id for the subject
295e8224fc2SMarkus Hoffrogge	 * @param   string  lang id for the template(.txt)
296e8224fc2SMarkus Hoffrogge	 * @param   array   array of replacements
297e8224fc2SMarkus Hoffrogge	 * @return  bool
298e8224fc2SMarkus Hoffrogge	 */
299e8224fc2SMarkus Hoffrogge	public function notifyByMail($subject_id, $template_id, $template_replacements) {
300e8224fc2SMarkus Hoffrogge		$ret = false;
301e8224fc2SMarkus Hoffrogge		dbglog("GitBacked - notifyByMail: [subject_id=".$subject_id.", template_id=".$template_id.", template_replacements=".$template_replacements."]");
302e8224fc2SMarkus Hoffrogge		if (!$this->isNotifyByEmailOnGitCommandError()) {
303e8224fc2SMarkus Hoffrogge			return $ret;
304e8224fc2SMarkus Hoffrogge		}
305e8224fc2SMarkus Hoffrogge		//$template_text = rawLocale($template_id); // this works for core artifacts only - not for plugins
306e8224fc2SMarkus Hoffrogge		$template_filename = $this->localFN($template_id);
307e8224fc2SMarkus Hoffrogge        $template_text = file_get_contents($template_filename);
308e8224fc2SMarkus Hoffrogge		$template_html = $this->render_text($template_text);
309e8224fc2SMarkus Hoffrogge
310e8224fc2SMarkus Hoffrogge		$mailer = new \Mailer();
311e8224fc2SMarkus Hoffrogge		$mailer->to($this->getEmailAddressOnErrorConfigured());
312e8224fc2SMarkus Hoffrogge		dbglog("GitBacked - lang check['".$subject_id."']: ".$this->getLang($subject_id));
313e8224fc2SMarkus Hoffrogge		dbglog("GitBacked - template text['".$template_id."']: ".$template_text);
314e8224fc2SMarkus Hoffrogge		dbglog("GitBacked - template html['".$template_id."']: ".$template_html);
315e8224fc2SMarkus Hoffrogge		$mailer->subject($this->getLang($subject_id));
316e8224fc2SMarkus Hoffrogge		$mailer->setBody($template_text, $template_replacements, null, $template_html);
317e8224fc2SMarkus Hoffrogge		$ret = $mailer->send();
318e8224fc2SMarkus Hoffrogge
319e8224fc2SMarkus Hoffrogge        return $ret;
320e8224fc2SMarkus Hoffrogge	}
321e8224fc2SMarkus Hoffrogge
322e8224fc2SMarkus Hoffrogge	/**
323e8224fc2SMarkus Hoffrogge	 * Check, if eMail is to be sent on a Git command error.
324e8224fc2SMarkus Hoffrogge	 *
325e8224fc2SMarkus Hoffrogge	 * @access  public
326e8224fc2SMarkus Hoffrogge	 * @return  bool
327e8224fc2SMarkus Hoffrogge	 */
328e8224fc2SMarkus Hoffrogge	public function isNotifyByEmailOnGitCommandError() {
329e8224fc2SMarkus Hoffrogge		$emailAddressOnError = $this->getEmailAddressOnErrorConfigured();
330e8224fc2SMarkus Hoffrogge		return !empty($emailAddressOnError);
331e8224fc2SMarkus Hoffrogge	}
332e8224fc2SMarkus Hoffrogge
333e8224fc2SMarkus Hoffrogge	/**
334e8224fc2SMarkus Hoffrogge	 * Get the eMail address configured for notifications.
335e8224fc2SMarkus Hoffrogge	 *
336e8224fc2SMarkus Hoffrogge	 * @access  public
337e8224fc2SMarkus Hoffrogge	 * @return  string
338e8224fc2SMarkus Hoffrogge	 */
339e8224fc2SMarkus Hoffrogge	public function getEmailAddressOnErrorConfigured() {
340e8224fc2SMarkus Hoffrogge		$emailAddressOnError = trim($this->getConf('emailAddressOnError'));
341e8224fc2SMarkus Hoffrogge		return $emailAddressOnError;
342fa53f2a3SWolfgang Gassler	}
343fa53f2a3SWolfgang Gassler
344fa53f2a3SWolfgang Gassler}
345fa53f2a3SWolfgang Gassler
346fa53f2a3SWolfgang Gassler// vim:ts=4:sw=4:et:
347