55 * PLUGIN INFORMATION BEGIN
66 * Plugin Name: Notifications.
77 * Plugin Author: Caleb M / Maikuolan.
8- * Plugin Version: 1.0.3
8+ * Plugin Version: 1.0.4
99 * Download Address: https://github.com/phpMussel/plugin-notifications
1010 * Min. Compatible: 0.10.0
1111 * Max. Compatible: -
1212 * Tested up to: 1.0.0-DEV
13- * Last Modified: 2016.05.29
13+ * Last Modified: 2016.06.27
1414 * PLUGIN INFORMATION END
1515 *
1616 * Receive email notifications from phpMussel whenever a file upload is
2727}
2828
2929/** Fallback for missing "notifications" configuration category. */
30- if (!isset ($ phpMussel ['MusselConfig ' ]['notifications ' ])) {
31- $ phpMussel ['MusselConfig ' ]['notifications ' ] = array ();
30+ if (!isset ($ phpMussel ['Config ' ]['notifications ' ])) {
31+ $ phpMussel ['Config ' ]['notifications ' ] = array ();
3232}
3333/** Fallback for missing "to_addr" configuration directive. */
34- if (!isset ($ phpMussel ['MusselConfig ' ]['notifications ' ]['to_addr ' ])) {
35- $ phpMussel ['MusselConfig ' ]['notifications ' ]['to_addr ' ] = '' ;
34+ if (!isset ($ phpMussel ['Config ' ]['notifications ' ]['to_addr ' ])) {
35+ $ phpMussel ['Config ' ]['notifications ' ]['to_addr ' ] = '' ;
3636}
3737/** Fallback for missing "from_addr" configuration directive. */
38- if (!isset ($ phpMussel ['MusselConfig ' ]['notifications ' ]['from_addr ' ])) {
39- $ phpMussel ['MusselConfig ' ]['notifications ' ]['from_addr ' ] = '' ;
38+ if (!isset ($ phpMussel ['Config ' ]['notifications ' ]['from_addr ' ])) {
39+ $ phpMussel ['Config ' ]['notifications ' ]['from_addr ' ] = '' ;
4040}
4141
4242/**
6363 function phpMussel_Notify ($ input ) {
6464 global $ phpMussel ;
6565 if (
66- empty ($ phpMussel ['MusselConfig ' ]['notifications ' ]['to_addr ' ]) ||
67- empty ($ phpMussel ['MusselConfig ' ]['notifications ' ]['from_addr ' ]) ||
66+ empty ($ phpMussel ['Config ' ]['notifications ' ]['to_addr ' ]) ||
67+ empty ($ phpMussel ['Config ' ]['notifications ' ]['from_addr ' ]) ||
6868 empty ($ phpMussel ['whyflagged ' ])
6969 ) {
7070 return false ;
7171 }
7272 $ NotifyLang =
73- (!file_exists ($ phpMussel ['vault ' ] . 'plugins/notifications/template. ' . $ phpMussel ['MusselConfig ' ]['general ' ]['lang ' ] . '.eml ' )) ?
73+ (!file_exists ($ phpMussel ['vault ' ] . 'plugins/notifications/template. ' . $ phpMussel ['Config ' ]['general ' ]['lang ' ] . '.eml ' )) ?
7474 'en ' :
75- $ phpMussel ['MusselConfig ' ]['general ' ]['lang ' ];
75+ $ phpMussel ['Config ' ]['general ' ]['lang ' ];
7676 $ content = phpMusselV (array (
7777 'whyflagged ' => $ phpMussel ['whyflagged ' ],
78- 'ipaddr ' => $ _SERVER [$ phpMussel ['MusselConfig ' ]['general ' ]['ipaddr ' ]],
78+ 'ipaddr ' => $ _SERVER [$ phpMussel ['Config ' ]['general ' ]['ipaddr ' ]],
7979 'time ' => date ('r ' )
8080 ), phpMusselFile ($ phpMussel ['vault ' ] . 'plugins/notifications/template. ' . $ NotifyLang . '.eml ' , 0 , true ));
8181 mail (
82- $ phpMussel ['MusselConfig ' ]['notifications ' ]['to_addr ' ],
83- $ phpMussel ['MusselConfig ' ]['lang ' ]['denied ' ],
82+ $ phpMussel ['Config ' ]['notifications ' ]['to_addr ' ],
83+ $ phpMussel ['Config ' ]['lang ' ]['denied ' ],
8484 $ content ,
85- "MIME-Version: 1.0 \nContent-type: text/plain; charset=iso-8859-1 \nFrom: " . $ phpMussel ['MusselConfig ' ]['notifications ' ]['from_addr ' ],
86- '-f ' . $ phpMussel ['MusselConfig ' ]['notifications ' ]['from_addr ' ]
85+ "MIME-Version: 1.0 \nContent-type: text/plain; charset=iso-8859-1 \nFrom: " . $ phpMussel ['Config ' ]['notifications ' ]['from_addr ' ],
86+ '-f ' . $ phpMussel ['Config ' ]['notifications ' ]['from_addr ' ]
8787 );
8888 return true ;
8989 }
@@ -104,27 +104,27 @@ function phpMussel_Notify($input) {
104104 */
105105 $ phpMussel_Notifications = function () use (&$ phpMussel ) {
106106 if (
107- empty ($ phpMussel ['MusselConfig ' ]['notifications ' ]['to_addr ' ]) ||
108- empty ($ phpMussel ['MusselConfig ' ]['notifications ' ]['from_addr ' ]) ||
107+ empty ($ phpMussel ['Config ' ]['notifications ' ]['to_addr ' ]) ||
108+ empty ($ phpMussel ['Config ' ]['notifications ' ]['from_addr ' ]) ||
109109 empty ($ phpMussel ['whyflagged ' ])
110110 ) {
111111 return false ;
112112 }
113113 $ NotifyLang =
114- (!file_exists ($ phpMussel ['vault ' ] . 'plugins/notifications/template. ' . $ phpMussel ['MusselConfig ' ]['general ' ]['lang ' ] . '.eml ' )) ?
114+ (!file_exists ($ phpMussel ['vault ' ] . 'plugins/notifications/template. ' . $ phpMussel ['Config ' ]['general ' ]['lang ' ] . '.eml ' )) ?
115115 'en ' :
116- $ phpMussel ['MusselConfig ' ]['general ' ]['lang ' ];
116+ $ phpMussel ['Config ' ]['general ' ]['lang ' ];
117117 $ content = $ phpMussel ['ParseVars ' ](array (
118118 'whyflagged ' => $ phpMussel ['whyflagged ' ],
119- 'ipaddr ' => $ _SERVER [$ phpMussel ['MusselConfig ' ]['general ' ]['ipaddr ' ]],
119+ 'ipaddr ' => $ _SERVER [$ phpMussel ['Config ' ]['general ' ]['ipaddr ' ]],
120120 'time ' => date ('r ' )
121121 ), $ phpMussel ['ReadFile ' ]($ phpMussel ['vault ' ] . 'plugins/notifications/template. ' . $ NotifyLang . '.eml ' , 0 , true ));
122122 mail (
123- $ phpMussel ['MusselConfig ' ]['notifications ' ]['to_addr ' ],
124- $ phpMussel ['MusselConfig ' ]['lang ' ]['denied ' ],
123+ $ phpMussel ['Config ' ]['notifications ' ]['to_addr ' ],
124+ $ phpMussel ['Config ' ]['lang ' ]['denied ' ],
125125 $ content ,
126- "MIME-Version: 1.0 \nContent-type: text/plain; charset=iso-8859-1 \nFrom: " . $ phpMussel ['MusselConfig ' ]['notifications ' ]['from_addr ' ],
127- '-f ' . $ phpMussel ['MusselConfig ' ]['notifications ' ]['from_addr ' ]
126+ "MIME-Version: 1.0 \nContent-type: text/plain; charset=iso-8859-1 \nFrom: " . $ phpMussel ['Config ' ]['notifications ' ]['from_addr ' ],
127+ '-f ' . $ phpMussel ['Config ' ]['notifications ' ]['from_addr ' ]
128128 );
129129 return true ;
130130 };
0 commit comments