PHP Files translated to english

This commit is contained in:
Christoph Haas 2016-11-29 15:24:22 +01:00
parent 9ff00b0f60
commit 244883d942
15 changed files with 1621 additions and 1228 deletions

View File

@ -4,15 +4,5 @@
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="PHARS">
<CLASSES>
<root url="phar://$MODULE_DIR$/php/composer.phar" />
</CLASSES>
<SOURCES>
<root url="phar://$MODULE_DIR$/php/composer.phar" />
</SOURCES>
</library>
</orderEntry>
</component>
</module>

View File

@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/contactimporter.iml" filepath="$PROJECT_DIR$/.idea/contactimporter.iml" />
</modules>
</component>
</project>

333
.idea/workspace.xml Normal file
View File

@ -0,0 +1,333 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="aae153d8-808f-4371-b0e9-9ee7ff904cab" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/contactimporter.iml" afterPath="$PROJECT_DIR$/.idea/contactimporter.iml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/config.php" afterPath="$PROJECT_DIR$/config.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/manifest.xml" afterPath="$PROJECT_DIR$/manifest.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/php/download.php" afterPath="$PROJECT_DIR$/php/download.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/php/module.contact.php" afterPath="$PROJECT_DIR$/php/module.contact.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/php/plugin.contactimporter.php" afterPath="$PROJECT_DIR$/php/plugin.contactimporter.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/php/upload.php" afterPath="$PROJECT_DIR$/php/upload.php" />
</list>
<ignored path="contactimporter.iws" />
<ignored path=".idea/workspace.xml" />
<ignored path=".idea/dataSources.local.xml" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="contactimporter" />
</component>
<component name="FileEditorManager">
<leaf />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/php/download.php" />
<option value="$PROJECT_DIR$/php/module.contact.php" />
<option value="$PROJECT_DIR$/php/upload.php" />
<option value="$PROJECT_DIR$/php/plugin.contactimporter.php" />
<option value="$PROJECT_DIR$/config.php" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="x" value="65" />
<option name="y" value="24" />
<option name="width" value="1792" />
<option name="height" value="999" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope">
<subPane subId="Project Files" />
<subPane subId="Default" />
</pane>
<pane id="Scratches" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="contactimporter" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="contactimporter" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="contactimporter" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="contactimporter" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="contactimporter" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="resources" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="contactimporter" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="contactimporter" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="resources" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="css" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="js-jscs-nodeInterpreter" value="/usr/bin/node" />
</component>
<component name="RunManager">
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
<method />
</configuration>
<configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="project" working-dir="">
<method />
</configuration>
<configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
<TestRunner />
<method />
</configuration>
<configuration default="true" type="PhpBehatConfigurationType" factoryName="Behat">
<BehatRunner />
<method />
</configuration>
<configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console">
<method />
</configuration>
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
<node-interpreter>project</node-interpreter>
<node-options />
<gulpfile />
<tasks />
<arguments />
<envs />
<method />
</configuration>
<configuration default="true" type="js.build_tools.npm" factoryName="npm">
<command value="run-script" />
<scripts />
<node-interpreter value="project" />
<envs />
<method />
</configuration>
<configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha">
<node-interpreter>project</node-interpreter>
<node-options />
<working-directory />
<pass-parent-env>true</pass-parent-env>
<envs />
<ui />
<extra-mocha-options />
<test-kind>DIRECTORY</test-kind>
<test-directory />
<recursive>false</recursive>
<method />
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="aae153d8-808f-4371-b0e9-9ee7ff904cab" name="Default" comment="" />
<created>1480428196914</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1480428196914</updated>
<workItem from="1480428199144" duration="44000" />
<workItem from="1480428259775" duration="69000" />
<workItem from="1480428330068" duration="1107000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="1220000" />
</component>
<component name="ToolWindowManager">
<frame x="65" y="24" width="1792" height="999" extended-state="6" />
<editor active="false" />
<layout>
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="1" />
</breakpoint-manager>
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/languages/de_DE.UTF-8/language.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/module.contact.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="25" column="0" selection-start-line="25" selection-start-column="0" selection-end-line="25" selection-end-column="0" />
<folding>
<element signature="e#6#919#0#PHP" expanded="true" />
<element signature="e#959#992#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/upload.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-196">
<caret line="2" column="55" selection-start-line="2" selection-start-column="55" selection-end-line="2" selection-end-column="55" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/plugin.contactimporter.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="675">
<caret line="84" column="83" selection-start-line="84" selection-start-column="83" selection-end-line="84" selection-end-column="83" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/download.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="615">
<caret line="41" column="0" selection-start-line="41" selection-start-column="0" selection-end-line="41" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/resources/css/contactimporter-main.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="75" selection-start-line="8" selection-start-column="75" selection-end-line="8" selection-end-column="75" />
<folding />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ScopeChooserConfigurable.UI">
<settings>
<last-edited>Unnamed</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

View File

@ -7,4 +7,3 @@ define('PLUGIN_CONTACTIMPORTER_DEFAULT', "Kontakte");
/** Tempory path for uploaded files... */
define('PLUGIN_CONTACTIMPORTER_TMP_UPLOAD', "/var/lib/kopano-webapp/tmp/");
?>

View File

@ -0,0 +1,2 @@
Deutsch
deu_DEU

View File

@ -0,0 +1,57 @@
msgid ""
msgstr ""
"Project-Id-Version: Plugin Contactimporter\n"
"POT-Creation-Date: 2016-11-29 15:23+0100\n"
"PO-Revision-Date: 2016-11-29 15:23+0100\n"
"Last-Translator: \n"
"Language-Team: Christoph Haas <christoph.h@sprinternet.at>\n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7.1\n"
"X-Poedit-Basepath: ../../../php\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPath-1: vendor\n"
#: module.contact.php:245
msgid "VCF file is empty!"
msgstr "VCF file is empty!"
#. TRANSLATORS: Filename suffix for exported files
#: module.contact.php:448
msgid "_contacts.vcf"
msgstr "_contacts.vcf"
#: module.contact.php:451
msgid "No contacts found. Export skipped!"
msgstr "No contacts found. Export skipped!"
#: module.contact.php:728
msgid "No contacts in vcf file"
msgstr "No contacts in vcf file"
#: module.contact.php:739
msgid "File could not be read by server"
msgstr "File could not be read by server"
#: module.contact.php:1141
msgid "Store could not be opened!"
msgstr "Store could not be opened!"
#: module.contact.php:1147
msgid "Wrong call, store and entryid have to be set!"
msgstr "Wrong call, store and entryid have to be set!"
#: upload.php:69
msgid ""
"File could not be moved to TMP path! Check plugin config and folder "
"permissions!"
msgstr ""
"File could not be moved to TMP path! Check plugin config and folder "
"permissions!"
#: upload.php:72
msgid "File could not be read by server, upload error!"
msgstr "File could not be read by server, upload error!"

View File

@ -0,0 +1,2 @@
English (US)
eng_USA

View File

@ -9,6 +9,9 @@
<authorURL>http://www.sprinternet.at</authorURL>
<description>Import or Export a VCF file to/from the zarafa addressbook</description>
</info>
<translations>
<translationsdir>languages</translationsdir>
</translations>
<config>
<configfile>config.php</configfile>
</config>

View File

@ -1,7 +1,7 @@
<?php
/**
* download.php, zarafa contact to vcf im/exporter
* download.php, Kopano Webapp contact to vcf im/exporter
*
* Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2016 Christoph Haas
@ -25,7 +25,6 @@ class DownloadHandler
{
/**
* Download the given vcf file.
* @return bool
*/
public static function doDownload()
{

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
<?php
/**
* plugin.contactimporter.php, zarafa contact to vcf im/exporter
* plugin.contactimporter.php, Kopano Webapp contact to vcf im/exporter
*
* Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2016 Christoph Haas
@ -30,63 +30,63 @@ require_once __DIR__ . "/download.php";
*/
class Plugincontactimporter extends Plugin
{
/**
* Constructor
*/
function __construct() {}
/**
* Constructor
*/
function __construct()
{
}
/**
* Function initializes the Plugin and registers all hooks
*
* @return void
*/
function init()
{
$this->registerHook('server.core.settings.init.before');
$this->registerHook('server.index.load.custom');
}
/**
* Function initializes the Plugin and registers all hooks
*
* @return void
*/
function init()
{
$this->registerHook('server.core.settings.init.before');
$this->registerHook('server.index.load.custom');
}
/**
* Function is executed when a hook is triggered by the PluginManager
*
* @param string $eventID the id of the triggered hook
* @param mixed $data object(s) related to the hook
* @return void
*/
function execute($eventID, &$data)
{
switch ($eventID) {
case 'server.core.settings.init.before' :
$this->injectPluginSettings($data);
break;
case 'server.index.load.custom':
if ($data['name'] == 'download_vcf') {
DownloadHandler::doDownload();
}
break;
}
}
/**
* Function is executed when a hook is triggered by the PluginManager
*
* @param string $eventID the id of the triggered hook
* @param mixed $data object(s) related to the hook
* @return void
*/
function execute($eventID, &$data)
{
switch ($eventID) {
case 'server.core.settings.init.before' :
$this->injectPluginSettings($data);
break;
case 'server.index.load.custom':
if ($data['name'] == 'download_vcf') {
DownloadHandler::doDownload();
}
break;
}
}
/**
* Called when the core Settings class is initialized and ready to accept sysadmin default
* settings.
* @param Array $data Reference to the data of the triggered hook
*/
function injectPluginSettings(&$data)
{
$data['settingsObj']->addSysAdminDefaults(Array(
'zarafa' => Array(
'v1' => Array(
'plugins' => Array(
'contactimporter' => Array(
'enable' => PLUGIN_CONTACTIMPORTER_USER_DEFAULT_ENABLE,
'default_addressbook' => PLUGIN_CONTACTIMPORTER_DEFAULT
)
)
)
)
));
}
/**
* Called when the core Settings class is initialized and ready to accept sysadmin default
* settings.
* @param [] $data Reference to the data of the triggered hook
*/
function injectPluginSettings(&$data)
{
$data['settingsObj']->addSysAdminDefaults(Array(
'zarafa' => Array(
'v1' => Array(
'plugins' => Array(
'contactimporter' => Array(
'enable' => PLUGIN_CONTACTIMPORTER_USER_DEFAULT_ENABLE,
'default_addressbook' => PLUGIN_CONTACTIMPORTER_DEFAULT
)
)
)
)
));
}
}
?>

View File

@ -1,6 +1,6 @@
<?php
/**
* upload.php, zarafa contact to vcf im/exporter
* upload.php, Kopano Webapp contact to vcf im/exporter
*
* Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2016 Christoph Haas
@ -32,7 +32,7 @@ ini_set('display_errors', '0');
*/
function respondJSON($arr)
{
echo json_encode($arr);
echo json_encode($arr);
}
/**
@ -42,33 +42,33 @@ function respondJSON($arr)
*/
function randomstring($length = 6)
{
// $chars - all allowed charakters
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
// $chars - all allowed charakters
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
srand((double)microtime() * 1000000);
$i = 0;
$pass = "";
while ($i < $length) {
$num = rand() % strlen($chars);
$tmp = substr($chars, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
srand((double)microtime() * 1000000);
$i = 0;
$pass = "";
while ($i < $length) {
$num = rand() % strlen($chars);
$tmp = substr($chars, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}
$destpath = PLUGIN_CONTACTIMPORTER_TMP_UPLOAD;
$destpath .= $_FILES['vcfdata']['name'] . randomstring();
if (is_readable($_FILES['vcfdata']['tmp_name'])) {
$result = move_uploaded_file($_FILES['vcfdata']['tmp_name'], $destpath);
$result = move_uploaded_file($_FILES['vcfdata']['tmp_name'], $destpath);
if ($result) {
respondJSON(array('success' => true, 'vcf_file' => $destpath));
} else {
respondJSON(array('success' => false, 'error' => "File could not be moved to TMP path! Check plugin config and folder permissions!"));
}
if ($result) {
respondJSON(array('success' => true, 'vcf_file' => $destpath));
} else {
respondJSON(array('success' => false, 'error' => dgettext("plugin_contactimporter", "File could not be moved to TMP path! Check plugin config and folder permissions!")));
}
} else {
respondJSON(array('success' => false, 'error' => "File could not be read by server, upload error!"));
respondJSON(array('success' => false, 'error' => dgettext("plugin_contactimporter", "File could not be read by server, upload error!")));
}
?>